Skip to content
Daniel Larsson edited this page Feb 14, 2025 · 1 revision

Simple scheduler

Settings specific to the simple scheduler.

  • type: Type of scheduler
    • simple: Standard scheduler
  • iterationtimebuffer:
    • mode: Time buffer mode. Defaults to nowait, if omitted.
      • nowait: No time buffer in between the iterations.
      • constant: Add a constant time buffer after each iteration. Defined by duration.
      • onerror: Add a time buffer in case of an error. Defined by duration.
      • minduration: Add a time buffer if the iteration duration is less than duration.
    • duration: Duration of the time buffer (for example, 500ms, 30s or 1m10s). Valid time units are ns, us (or µs), ms, s, m, and h.
  • instance: Instance number for this instance. Use different instance numbers when running the same script in multiple instances to make sure the randomization is different in each instance. Defaults to 1.
  • reconnectsettings: Settings for enabling re-connection attempts in case of unexpected disconnects.
    • reconnect: Enable re-connection attempts if the WebSocket is disconnected. Defaults to false.
    • backoff: Re-connection backoff scheme. Defaults to [0.0, 2.0, 2.0, 2.0, 2.0, 2.0, 4.0, 4.0, 8.0, 12.0, 16.0], if left empty. An example backoff scheme could be [0.0, 1.0, 10.0, 20.0]:
      • 0.0: If the WebSocket is disconnected, wait 0.0s before attempting to re-connect
      • 1.0: If the previous attempt to re-connect failed, wait 1.0s before attempting again
      • 10.0: If the previous attempt to re-connect failed, wait 10.0s before attempting again
      • 20.0: If the previous attempt to re-connect failed, wait 20.0s before attempting again
  • settings:
    • executionTime: Test execution time (seconds). The sessions are disconnected when the specified time has elapsed. Allowed values are positive integers. -1 means an infinite execution time.
    • iterations: Number of iterations for each 'concurrent' user to repeat. Allowed values are positive integers. -1 means an infinite number of iterations.
    • rampupDelay: Time delay (seconds) scheduled in between each concurrent user during the startup period.
    • concurrentUsers: Number of concurrent users to simulate. Allowed values are positive integers.
    • reuseUsers:
      • true: Every iteration for each concurrent user uses the same user and session.
      • false: Every iteration for each concurrent user uses a new user and session. The total number of users is the product of concurrentusers and iterations.
    • onlyinstanceseed: Disable session part of randomization seed. Defaults to false, if omitted.
      • true: All users and sessions have the same randomization sequence, which only changes if the instance flag is changed.
      • false: Normal randomization sequence, dependent on both the instance parameter and the current user session.

Using reconnectsettings

If reconnectsettings.reconnect is enabled, the following is attempted:

  1. Re-connect the WebSocket.
  2. Get the currently opened app in the re-attached engine session.
  3. Re-subscribe to the same object as before the disconnection.
  4. If successful, the action during which the re-connect happened is logged as a successful action with action and label changed to Reconnect(action) and Reconnect(label).
  5. Restart the action that was executed when the disconnection occurred (unless it is a thinktime action, which will not be restarted).
  6. Log an info row with info type WebsocketReconnect and with a semicolon-separated details section as follows: "success=X;attempts=Y;TimeSpent=Z"
    • X: True/false
    • Y: An integer representing the number of re-connection attempts
    • Z: The time spent re-connecting (ms)

Example

Simple scheduler settings:

"scheduler": {
   "type": "simple",
   "settings": {
       "executiontime": 120,
       "iterations": -1,
       "rampupdelay": 7.0,
       "concurrentusers": 10
   },
   "iterationtimebuffer" : {
       "mode": "onerror",
       "duration" : "5s"
   },
   "instance" : 2
}

Simple scheduler set to attempt re-connection in case of an unexpected WebSocket disconnection:

"scheduler": {
   "type": "simple",
   "settings": {
       "executiontime": 120,
       "iterations": -1,
       "rampupdelay": 7.0,
       "concurrentusers": 10
   },
   "iterationtimebuffer" : {
       "mode": "onerror",
       "duration" : "5s"
   },
    "reconnectsettings" : {
      "reconnect" : true
    }
}
Clone this wiki locally