Class LoadPacing


public class LoadPacing extends ObjectWithJsonToString
Adaptive iteration pacing (think-time) for a LoadScenario: a target per-virtual-user iteration cycle time. After a closed-model VU finishes one pass through the steps, the orchestrator waits whatever remains of the target cycle before launching that VU's next iteration; if the iteration's work overran the cycle, the next iteration starts immediately (no wait). This smooths a closed-model VU loop toward a target per-VU iteration rate (Locust constant_pacing/constant_throughput, Gatling pace).

Scope: pacing governs only the closed-model VU loop (looping iterations). One-shot open-model RATE iterations ignore pacing — their arrival rate already governs the spacing between starts. Pacing composes with (it does not replace) per-step thinkTime: thinkTime adds intra-iteration pauses between steps; pacing targets the whole iteration cycle and only delays the start of the NEXT iteration. Pacing never alters in-flight latency measurement (the coordinated-omission-corrected sample is unchanged) — it only changes when the next iteration launches.

See Also:
  • Constructor Details

    • LoadPacing

      public LoadPacing()
  • Method Details

    • loadPacing

      public static LoadPacing loadPacing()
    • constantPacing

      public static LoadPacing constantPacing(double cycleMillis)
      Convenience: a constant-pacing target cycle in milliseconds.
    • constantThroughput

      public static LoadPacing constantThroughput(double iterationsPerSecond)
      Convenience: a constant-throughput target of iterationsPerSecond per VU.
    • getMode

      public LoadPacing.Mode getMode()
    • withMode

      public LoadPacing withMode(LoadPacing.Mode mode)
    • getValue

      public double getValue()
    • withValue

      public LoadPacing withValue(double value)
    • cycleMillis

      public double cycleMillis()
      The target iteration cycle in milliseconds derived from mode and value, or 0 when there is no pacing (LoadPacing.Mode.NONE, a null mode, or a non-positive value). LoadPacing.Mode.CONSTANT_PACING returns value; LoadPacing.Mode.CONSTANT_THROUGHPUT returns 1000 / value.