Class LoadProfile


public class LoadProfile extends ObjectWithJsonToString
The load profile of a LoadScenario: an ordered list of LoadStages the orchestrator runs in sequence. Each stage holds or ramps a setpoint — concurrent virtual users (closed model, LoadStageType.VU), an arrival rate in iterations/second (open model, LoadStageType.RATE), or no load at all (LoadStageType.PAUSE) — for its durationMillis, optionally shaped by a RampCurve.

The total run duration is the sum of the stage durations; the orchestrator advances stage by stage and ends after the last one (or when maxRequests is hit, or on stop). Per-stage setpoint functions (LoadStage.targetVusAt(long) / LoadStage.targetRateAt(long)) are pure and deterministic so ramp progression is unit-testable without driving traffic.

A profile may instead carry a declarative LoadShape (a named SPIKE / STAIRS / RAMP_HOLD pattern). When a shape is set and no explicit stages are present, getStages() returns the stages expanded from the shape — so the orchestrator, which only ever calls getStages(), needs no change. Explicit stages always win: if both are set the shape is ignored.

  • Constructor Details

    • LoadProfile

      public LoadProfile()
  • Method Details

    • loadProfile

      public static LoadProfile loadProfile()
    • of

      public static LoadProfile of(LoadStage... stages)
    • constant

      public static LoadProfile constant(int vus, long durationMillis)
      Convenience: a single constant-VU stage.
    • linear

      public static LoadProfile linear(int startVus, int endVus, long durationMillis)
      Convenience: a single linear VU ramp stage.
    • constantRate

      public static LoadProfile constantRate(double rate, long durationMillis)
      Convenience: a single constant arrival-rate (iterations/second) stage.
    • shaped

      public static LoadProfile shaped(LoadShape shape)
      Convenience: a named load shape.
    • getStages

      public List<LoadStage> getStages()
      The ordered stages the orchestrator runs. Explicit stages always win; otherwise, when a shape is set, this returns its expansion (computed once and cached). With neither, this is the (empty) explicit stages list.
    • getRawStages

      public List<LoadStage> getRawStages()
      The explicit stages exactly as set (never the shape expansion) — used by serialization.
    • getShape

      public LoadShape getShape()
    • withShape

      public LoadProfile withShape(LoadShape shape)
    • withStages

      public LoadProfile withStages(List<LoadStage> stages)
    • withStages

      public LoadProfile withStages(LoadStage... stages)
    • addStage

      public LoadProfile addStage(LoadStage stage)
    • totalDurationMillis

      public long totalDurationMillis()
      Sum of all stage durations — the total run length (reflects the shape expansion).
    • peakVus

      public int peakVus()
      The maximum VU count any stage requests, used to enforce the VU hard cap up-front.
    • peakRate

      public double peakRate()
      The maximum arrival rate any stage requests, used to enforce the rate hard cap up-front.