Class LoadStage


public class LoadStage extends ObjectWithJsonToString
One stage of a LoadProfile: a contiguous slice of the run holding or ramping a setpoint for durationMillis. Stages run in sequence; the total run ends after the last stage (or when maxRequests is hit, or on stop).

A stage is one of three LoadStageTypes:

  • LoadStageType.VU — closed model. Either holds vus or ramps from startVus to endVus along the curve.
  • LoadStageType.RATE — open model. Either holds rate or ramps from startRate to endRate (iterations/second) along the curve, optionally capped at maxVus virtual users for this stage (else the global VU cap).
  • LoadStageType.PAUSE — drives no load for durationMillis.

targetVusAt(long) and targetRateAt(long) are the pure, deterministic setpoint functions the orchestrator reads each control tick; both honour the curve.

  • Constructor Details

    • LoadStage

      public LoadStage()
  • Method Details

    • loadStage

      public static LoadStage loadStage()
    • constantVus

      public static LoadStage constantVus(int vus, long durationMillis)
    • rampVus

      public static LoadStage rampVus(int startVus, int endVus, long durationMillis, RampCurve curve)
    • rampVus

      public static LoadStage rampVus(int startVus, int endVus, long durationMillis)
    • constantRate

      public static LoadStage constantRate(double rate, long durationMillis)
    • rampRate

      public static LoadStage rampRate(double startRate, double endRate, long durationMillis, RampCurve curve)
    • rampRate

      public static LoadStage rampRate(double startRate, double endRate, long durationMillis)
    • pause

      public static LoadStage pause(long durationMillis)
    • isVuRamp

      public boolean isVuRamp()
      True when this VU stage is a ramp (both start and end VUs supplied), else a hold.
    • isRateRamp

      public boolean isRateRamp()
      True when this RATE stage is a ramp (both start and end rate supplied), else a hold.
    • targetVusAt

      public int targetVusAt(long elapsedInStageMillis)
      The target VU setpoint at elapsedInStageMillis into this VU stage. For a hold this is vus; for a ramp it is round(curve.valueAt(startVus, endVus, progress)). Returns 0 for non-VU stages.
    • targetRateAt

      public double targetRateAt(long elapsedInStageMillis)
      The target arrival rate (iterations/second) at elapsedInStageMillis into this RATE stage. For a hold this is rate; for a ramp it is curve.valueAt(startRate, endRate, progress). Returns 0 for non-RATE stages.
    • peakVus

      public int peakVus()
      The largest VU count this stage can request (used to enforce the VU cap up-front regardless of shape).
    • peakRate

      public double peakRate()
      The largest arrival rate this stage can request (used to enforce the rate cap up-front).
    • getType

      public LoadStageType getType()
    • withType

      public LoadStage withType(LoadStageType type)
    • getDurationMillis

      public long getDurationMillis()
    • withDurationMillis

      public LoadStage withDurationMillis(long durationMillis)
    • getCurve

      public RampCurve getCurve()
    • withCurve

      public LoadStage withCurve(RampCurve curve)
    • getVus

      public Integer getVus()
    • withVus

      public LoadStage withVus(Integer vus)
    • getStartVus

      public Integer getStartVus()
    • withStartVus

      public LoadStage withStartVus(Integer startVus)
    • getEndVus

      public Integer getEndVus()
    • withEndVus

      public LoadStage withEndVus(Integer endVus)
    • getRate

      public Double getRate()
    • withRate

      public LoadStage withRate(Double rate)
    • getStartRate

      public Double getStartRate()
    • withStartRate

      public LoadStage withStartRate(Double startRate)
    • getEndRate

      public Double getEndRate()
    • withEndRate

      public LoadStage withEndRate(Double endRate)
    • getMaxVus

      public Integer getMaxVus()
    • withMaxVus

      public LoadStage withMaxVus(Integer maxVus)