Class Track
Extends
CompositionItem.
Constructor Attributes | Constructor Name and Description |
---|---|
Track()
Represents a Track within the Composition.
|
Field Attributes | Field Name and Description |
---|---|
{String} |
The name of the Distribution that this instance of the Track
originated from.
|
{String} |
The value "Track".
|
- Fields borrowed from class CompositionItem:
- children, completionType, failureText, forEachValue, hasErrorEvents, index, name, nextItem, parent, path, playNumber, playNumberBeforeRenewal, playNumberWithinRenewal, previousItem, propertyList, REPEAT_DISTRIBUTION_CONSTANT, REPEAT_TIMING_PARALLEL, REPEAT_TIMING_SERIAL, REPEAT_TYPE_COUNT_CONSTANT, repeatIndex, systemPropertyList
Method Attributes | Method Name and Description |
---|---|
{object} |
currentDistributionRampHold(maxWaitTime)
Adjusts the ramp state for the current Track and the current
Distribution within the Track in which the current Script resides
to hold at the current level of virtual users.
|
{object} |
currentDistributionRampTo(maxWaitTime, userCount, time)
Adjusts the ramp state for the current Track and the current
Distribution within the Track in which the current Script resides.
|
Prohibits any further instances of the Track from being created on the
current server.
|
|
stop()
Stops play of the current instance of the Track.
|
|
Stops play of all instances of the Track.
|
- Methods borrowed from class CompositionItem:
- clearRepeat, end, endRepeat, getChild, getItemViaPath, setRepeat
"Ramp" is defined as Track parallel repeating with a "start interval" and/or "end interval". The use of parallel repeat renewal is required for ramp adjustments to work properly.
This method may be called at any time, including when the ramp is paused or pausing, or when it is already resuming.
This method institutes the new ramping request, but does not wait for the specified ramping goal to actually be reached, as that might occur much later.
Each server on which the Distribution of the Track resides will hold at the current number of virtual users at the time at which the request reaches that server, which may be some time later than when the Script executes, depending upon the number of servers in the Composition, network communication time, etc.
For multi-server Compositions, the request may take some time before it is accepted by all of the servers on which the Distribution of the Track resides, depending upon the number of servers, network communication time and errors, and so forth. The caller may choose whether or not to wait for the request to reach, and be accepted by, all servers. If it is chosen not to wait, then it is not possible for the Script to check back later in order to find out the eventual disposition of the request.
The return value is a "struct" -- an object with properties (fields) with certain names.
- "requestStatus" (String) -- An indicator as to whether the request has been completely accepted or not. Will be either "Pending" or "Completed".
- "requestNumber" (Number) -- An integer number is assigned to every ramp adjustment request, whther made by the user or from a Script. This number appears in events and error messages in the Result for identification purposes.
- "resultText" (String) -- If the request has completed, this contains multi-line text and messages describing what happened. This field will be empty if the request is still "pending".
Here is an example Script that changes the current Distribution of the current Track to hold at the current level of virtual users. It waits until the adjustment is accepted and then outputs information about the request to the Result.
var out = $context.currentTrack.currentDistributionRampHold(null); var details = "requestStatus=" + out.requestStatus + "\n"; details += "requestNumber=" + out.requestNumber + "\n"; details += "resultText=" + out.resultText + "\n"; $context.result.postMessage($context.result.LEVEL_INFO, "Disposition of ramp request", details);
- Parameters:
- {number} maxWaitTime
The maximum amount of time to wait for the request to complete, in milliseconds. A null or negative value specifies that the call will not return until the adjustments have been accepted.
- Since:
- Build 6165
- Returns:
- {object}
An object that contains properties (fields) that indicate the status of the request (see above).
"Ramp" is defined as Track parallel repeating with a "start interval" and/or "end interval". The use of parallel repeat renewal is required for ramp adjustments to work properly.
This method may be called at any time, including when the ramp is paused or pausing, or when it is already resuming.
This method institutes the new ramping request, but does not wait for the specified ramping goal to actually be reached, as that might occur much later.
For multi-server Compositions, the request may take some time before it is accepted by all of the servers on which the Distribution of the Track resides, depending upon the number of servers, network communication time and errors, and so forth. The caller may choose whether or not to wait for the request to reach, and be accepted by, all servers. If it is chosen not to wait, then it is not possible for the Script to check back later in order to find out the eventual disposition of the request.
The return value is a "struct" -- an object with properties (fields) with certain names.
- "requestStatus" (String) -- An indicator as to whether the request has been completely accepted or not. Will be either "Pending" or "Completed".
- "requestNumber" (Number) -- An integer number is assigned to every ramp adjustment request, whther made by the user or from a Script. This number appears in events and error messages in the Result for identification purposes.
- "resultText" (String) -- If the request has completed, this contains multi-line text and messages describing what happened. This field will be empty if the request is still "pending".
Here is an example Script that changes the current Distribution of the current Track to ramp to 400 users over 5 minutes. It waits until the adjustment is accepted and then outputs information about the request to the Result.
var out = $context.currentTrack.currentDistributionRampTo(null, 400, 300000); var details = "requestStatus=" + out.requestStatus + "\n"; details += "requestNumber=" + out.requestNumber + "\n"; details += "resultText=" + out.resultText + "\n"; $context.result.postMessage($context.result.LEVEL_INFO, "Disposition of ramp request", details);
- Parameters:
- {number} maxWaitTime
The maximum amount of time to wait for the request to complete, in milliseconds. A null or negative value specifies that the call will not return until the adjustments have been accepted.
- {number} userCount
The number of virtual users to ramp to. May be more (ramp up) or less (ramp down) than the current number of virtual users. This number is the total for all copies of this Distribution of this Track on all servers -- the count will be automatically distributed as evenly as possible across all servers on which copies of the Distribution of the Track reside.
- {number} time
The amount of time, in milliseconds, over which the ramp up or down is to take place. Must be greater than or equal to zero.
- Since:
- Build 6165
- Returns:
- {object}
An object that contains properties (fields) that indicate the status of the request (see above).
Any existing instances of the Track that have already started will be allowed to finish normally.
The prohibition on new instances of the Track takes effect as soon as the call is made. Once the prohibition is in effect, it cannot be cancelled.
If the Track has been copied to multiple servers (for example by entering a value into the "Copy Count" field when "Dedicated Load Server" is selected in the "General" tab in the Composition Editor), this call will only affect instances of the Track on the individual server on which the current Track is playing. It will not affect copies of the Track that are playing on other servers.
- Since:
- Build 5030
The stop will occur immediately once the calling Script ends.
Wherever this call is made within the Track hierarchy, all items in the current instance of the Track will be stopped. For example, the Clip containing the current Script will be stopped, no further items in the Clip will play and no new Clips will be started in the current Track instance.
- Since:
- Build 5030
The stop will occur for the current instance of the Track once the calling Script ends. The stop will occur immediately during the call for all other instances of the Track.
All instances of the Track will be stopped and no further items will play. For example, containing Clips will be stopped, no further items in the Clip will play and no new Clips will be started.
If the Track has been copied to multiple servers (for example by entering a value into the "Copy Count" field when "Dedicated Load Server" is selected in the "General" tab in the Composition Editor), this call will only affect instances of the Track on the individual server on which the current Track is playing. It will not affect copies of the Track that are playing on other servers.
- Since:
- Build 5030