Skip to end of metadata
Go to start of metadata

A function instance returns a determined on-the-fly value of a specific type. The value is assigned to a variable with the same name, which is used to parameterize requests.

The returned value depends on the function type and the context where the function is called from. Some of the function types provide access to internal load engine variables.

The function instance is evaluated before issuing a request.

The following function types are supported:

FunctionReturn Value
Agent Name The name of the current agent
Agent VU NumberThe current VU number within an Agent’s pool of VUs
Test Case NameThe current test case name
Agent Iteration NumberThe current iteration number executed by an Agent
URL Number The current request number within a test case
Agent Request Number The current request number issued by an Agent from the beginning of the test
Current Date Time The current date time stamp
Current UTC Date Time  The current date UTC timestamp

How to Create a Function Instance

  1. Select the Function node on the Test Workflow Tree.
  2. Click New to bring up the Function dialog.
  3. Select a Function Type.
  4. Configure its properties and give it a unique name. It will appear in the Variable Picker when you create parameters. Use the Format String property to format the generator output.
  5. Click Verify to test the return value.
  6. Click Save & Close

When the Function instance is used to parameterize a request, it is referred by its name surrounded by brackets, for example {{MyFunction}}

When the Variable Picker is used to create a parameter, the properly formatted function instance reference is inserted automatically.

The function instance is evaluated just before issuing the requests. For example, if you use the Current Date Time function in 3 requests, it will be called 3 times and will return 3 different instant time values.

Date Time Functions

StresStimulus supports two date and time functions:

  • Current Date Time  - Returns the local date and time at the time of evaluation.
  • Current UTC Date Time   - Returns the universal (GMT) date and time at the time of evaluation.

These functions use the following additional attributes:

  • Time offset (s) - The number of seconds to add (or subtract if the value is negative) from the resulting date-time. Example: use this property to create an expiration time in the future.
  • Use Unix Time format - This returns the date-time as Unix time (Epoch time) format, which is the number of seconds that have elapsed since January 1, 1970.

  • No labels