This document describes the HTTP Streaming Tasks, provided as custom tasks that must be installed with PureLoad/PureTest for each installation using these tasks.
Before you use the tasks, read more about installing and how to load custom tasks.
The HTTP streaming task is used to simulate Adaptive Streaming over HTTP. Supported protocols are HLS (Apple), HSS (Microsoft), HDS (Adobe) and DASH (MPEG). See Supported HTTP Streaming Protocols for details. The word "adaptive" refers to the ability to shift between different bitrates of the media to compensate for changes in the available bandwidth. This is covered in more detail in the Introduction to HTTP Streaming and Load Testing document.
All tasks are based on the generic PureLoad HTTP support. This
means, for example, that a standard HttpInitTask may be used to
set up bandwidth limitation, SSL etc.
There are three types of custom tasks for HTTP Streaming:
HttpStreamingXyzInitTask
This is an initialisation task that requests stream meta data
(i.e. information about how to run the stream). This task is media
type specific, "Xyz" is to be replaced with "Hls", "Hss", "Hds" or
"Dash".
Files containing meta data are called "Manifests". The first downloaded manifest is called the "Master Playlist Manifest".
HttpStreamingXyzSetQualityTask.
This task sets the media quality of the following media segment
downloads. This quality will be used until a new
HttpStreamingXyzSetQualityTask is run. The "Media Quality"
translates to the file size of the downloaded segments.
For some media types (Hls and Hds) stream meta data may be split
into several manifests. For these media types the
HttpStreamingXyzSetQualityTask may make an additional HTTP request
for a media quality specific manifest.
This task takes the media quality as a parameter. Media quality is given as an integer. Alternatively, the media quality parameter can be given as "low", "medium" or "high" for convenience.
Adaptive bitrate can be automatically simulated by specifying an
expected bitrate and threshold values for when to perform a shift
in quality.
HttpStreamingMediaSegmentTask
This task downloads one media segment. The task is intended to be
used in a "Sequence" and in conjunction with a "SleepTask" to
simulate the play time of the segment.
HttpStreamingMediaSegmentTask is generic for all media types.
An HTTP streaming scenario basically consists of:
The HttpStreamingXyzInitTask has a URL parameter. This must be an
address to a Master Playlist Manifest file. This manifest
represents the entire media and the URL is usually seen as the
address to the actual media (e.g. a movie).
The initial media quality to use must be set in a
HttpStreamingXyzSetQualityTask. Quality is measured differently
for different media. It can be given as bandwidth, resolution,
bitrate or something else, but it is always given as an integer. A
list of available media qualities can be found in the "Execution
Log" after running the HttpStreamingXyzInitTask.
Look for something similar to this to learn about available
qualities:
[INFO] This stream is available in the following qualities:
200000 (low)
311111 (medium)
484444
737777 (high)
Note that the media quality can also be given as one of "low",
"medium" or "high".
After having read the meta data manifests, the number of media
segments to be played is determined. One or more sequences has to
be created that iterates over these media segments. In the
sequence, set the "Iterations" parameter to either a specified
number of iterations or to ${remainingSegments} to iterate over
all the remaining tasks. If you specify a number of iterations
that exceeds the number of media segments, a
TaskExecutionException will be thrown and the Scenario will stop
execution.
To make the Scenario simulate an actual media player you can add
a SleepTask after the HttpStreamingMediaSegmentTask. The SleepTask
sleeps the time an actual media player would have spent playing
the downloaded Media Segment. In the SleepTask set the "Sleep
Time" parameter to ${playtimeSlack}. To understand play time slack
see here.
After the last media segment has been downloaded the scenario
ends without sleeping the remaining playing time, i.e.
"playTimeSlack" is set to zero.
If set (i.e. when given a value > -1) a variable "endOfStream" will be set to true before running a segment that will run past the maxRunningTime. This can be used to conditionally break sequences when (or actually right before) the maxRunningTime is reached.
There is an option to reuse the address of a 302 redirect in
subsequent calls instead of always using the original address and
get a new redirect for each request. When chosen (set to true),
this option will cause requests for media segments following a
redirected request for a media playlist to reuse the redirect
address of the media playlist request.
For LIVE streams, subsequent requests for the same media playlist
will also reuse the redirect.
The following is a complete list of the tasks provided in the HTTP Streaming package:
This task reads an HLS master playlist manifest specified by the
given "URL" and makes the master playlist available to subsequent
tasks.
To set proxy, verbose flag and other common parameters use the
HttpInitTask before this task.
URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to
all URLs (specified in URL format: name1=value1&name2=value2
..)
Query String Main Manifest Only - Flag indicating if query
string should be used only for the main manifest or for all
requests.
Reuse Redirect URL - Reuse redirect URL when requesting
media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream}
variable will be set to true. Use it to conditionally break
sequence.
Remaining Segments Variable Name - Name of the variable
containing the number of remaining iterations to do over Media
Segments.
Expected Response Codes - Comma separated list of valid
response codes.
This task chooses the media playlist to play based on the "Media
Quality" parameter.
This task exports a variable "remainingSegments" that can be set
as the number of iterations in a following Sequence.
This task reads the HLS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.
Media Quality - The Media Quality to be used for the
following media segment downloads. Quality can either be defined
as one of "low", "medium" or "high" or it can be given as an exact
integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in
kilobit per second. If set, this will enable adaptive bitrate and
shift quality as needed. (Set to 0 to disable adaptive bitrate and
only set quality manually.)
Downshift Threshold (%) - Threshold in percent of expected
bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected
bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive
times a threshold must be exceeded before a shift of quality is
done.
This task reads an HSS master playlist manifest specified by the
given "URL" and makes the master playlist available to subsequent
tasks.
To set proxy, verbose flag and other common parameters use the
HttpInitTask before this task.
This task chooses the media playlist to play based on the "Media
Quality" parameter.
This task exports a variable "remainingSegments" that can be set
as the number of iterations in a following Sequence.
This task reads the HSS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.
Media Quality - The Media Quality to be used for the
following media segment downloads. Quality can either be defined
as one of "low", "medium" or "high" or it can be given as an exact
integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in
bit/s. If set, this will enable adaptive bitrate and shift quality
as needed. (Set to 0 to disable adaptive bitrate and only set
quality manually.)
Downshift Threshold (%) - Threshold in percent of expected
bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected
bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive
times a threshold must be exceeded before a shift of quality is
done.
This task reads an HDS master playlist manifest specified by the
given "URL" and makes the master playlist available to subsequent
tasks.
To set proxy, verbose flag and other common parameters use the
HttpInitTask before this task.
URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to
all URLs (specified in URL format: name1=value1&name2=value2
..)
Query String Main Manifest Only - Flag indicating if query
string should be used only for the main manifest or for all
requests.
Reuse Redirect URL - Reuse redirect URL when requesting
media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream}
variable will be set to true. Use it to conditionally break
sequence.
Remaining Segments Variable Name - Name of the variable
containing the number of remaining iterations to do over Media
Segments.
Expected Response Codes - Comma separated list of valid
response codes.
This task chooses the media playlist to play based on the "Media
Quality" parameter.
This task exports a variable "remainingSegments" that can be set
as the number of iterations in a following Sequence.
This task reads the HDS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.
ParametersMedia Quality - The Media Quality to be used for the
following media segment downloads. Quality can either be
defined as one of "low", "medium" or "high" or it can be given
as an exact integer. See the execution log to see available
qualities.
Expected Bitrate - Expected segment download bitrate in
bit/s. If set, this will enable adaptive bitrate and shift
quality as needed. (Set to 0 to disable adaptive bitrate and
only set quality manually.)
Downshift Threshold (%) - Threshold in percent of
expected bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of
expected bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of
consecutive times a threshold must be exceeded before a shift
of quality is done.
This task reads an DASH master playlist manifest specified by the
given "URL" and makes the master playlist available to subsequent
tasks.
To set proxy, verbose flag and other common parameters use the
HttpInitTask before this task.
This task chooses the media playlist to play based on the "Media
Quality" parameter.
This task exports a variable "remainingSegments" that can be set
as the number of iterations in a following Sequence.
This task reads the DASH media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.
This task downloads a media segment and calculates the "slack"
time, i.e. the segment playtime left after subtracting the time
for the download (slack = segmentPlaytime -
timeToDownloadSegment). The slack time is stored in the "Playtime
Slack variable".
Playtime Slack Variable - The name of the variable carrying the "Playtime Slack", or the time to sleep by the subsequent Sleep Task . Default: playtimeSlack .
This task to collects additional HTTP streaming results in background and write them to a CSV file at a specified time slot interval.
The CSV will have the following columns:CVS File Path - Path to streaming report CSV file.
Time Slot Interval (s) - Time in seconds between each time
streaming information is written to disk.
Media Qualities - Comma separated list of video media
qualities to count segments for (qualities not in list is reported
as 'other').