Gery
Gery

Reputation: 575

How to simulate Media Streaming with Gatling

So in my simulation I need to replicate a page that contains a media player and streams a video also from the same backend.

Using the Get request from Gatling, it will download the entire video at once, instead of downloading only partial content like in a browser would happen.

Is there a way to control or pace download streams so it does not download the entire video at once but by partial content as it happens in the browser?

Upvotes: 1

Views: 1228

Answers (1)

aergistal
aergistal

Reputation: 31209

What you describe is called progressive download or pseudo-streaming. This is different from say streaming achieved via a streaming protocol like HLS.

Progressive download uses HTTP range requests.

I haven't used yet but I see it supports setting headers for HTTP requests. It should be possible to set the appropriate Range headers. Check the first link for examples.

If it works you'll see 206 Partial Content responses.

Try something along the lines of:

http("Progressive download")
  .get("url")
  .header("Range", "bytes=0-1023")

Upvotes: 3

Related Questions