Class LoadShapes

java.lang.Object
org.mockserver.load.LoadShapes

public final class LoadShapes extends Object
Expands a declarative LoadShape into the ordinary list of LoadStages the orchestrator runs. This is the single source of truth for shape → stage expansion; it is pure and side-effect-free (it only reads the shape and builds stages with the existing LoadStage builders), so LoadProfile.getStages() can call it lazily and the result is unit-testable without driving traffic.

Design choices (documented because they are observable in the expansion):

  • STAIRS are pure steps — each step is a single constant hold at start + i*step; there is no inter-step ramp (a flight of stairs is discrete by definition, and pure holds are the simplest faithful expansion).
  • RATE expansions leave maxVus unset on every stage, so the global loadGenerationMaxVirtualUsers cap governs the auto-scaled VU pool. A shape does not impose its own (lower) per-stage VU cap — pick the safe option that never silently throttles below the configured global limit.
  • VU setpoints are integers — VU parameters are rounded to the nearest whole VU when the shape is built into VU stages; RATE parameters stay fractional iterations/second.
  • Method Details

    • expand

      public static List<LoadStage> expand(LoadShape shape)
      Expand shape into its ordered list of LoadStages, or an empty list when shape is null or has no type. The returned list is a fresh, mutable ArrayList owned by the caller.