Package org.mockserver.load
Class LoadShape
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.load.LoadShape
A declarative, named load shape on a
LoadProfile. A shape is a high-level description of a
common traffic pattern (a SPIKE, a flight of STAIRS, a RAMP_HOLD) that LoadShapes.expand(org.mockserver.load.LoadShape)
turns into the ordinary list of LoadStages the orchestrator already runs. A profile carries
either an explicit stages list or a shape
— when a shape is set and no explicit stages are present, LoadProfile.getStages() returns the
expanded stages, so the orchestrator needs no changes.
Each shape drives one LoadShape.Metric: LoadShape.Metric.VU (concurrent virtual users, closed model)
or LoadShape.Metric.RATE (arrival rate in iterations/second, open model). The numeric parameters are
interpreted per LoadShape.Type — only the subset each type needs is read (see each type's javadoc on
LoadShape.Type); the rest are ignored.
| Type | Parameters |
|---|---|
LoadShape.Type.SPIKE |
baseline, peak, rampUpMillis, holdMillis,
rampDownMillis, optional recoveryHoldMillis (hold at baseline after
the down-ramp). curve shapes both ramps. |
LoadShape.Type.STAIRS |
start, step, steps (count), stepDurationMillis (each step
holds at its level — pure steps, no inter-step ramp). |
LoadShape.Type.RAMP_HOLD |
target, rampMillis, holdMillis, optional curve (default
RampCurve.LINEAR) — ramp 0 → target then hold target. |
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether a shape drives concurrent virtual users (LoadShape.Metric.VU) or an arrival rate (LoadShape.Metric.RATE).static enumThe kind of named shape. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCurve()getPeak()getStart()getStep()getSteps()getType()static LoadShapestatic LoadShaperampHold(LoadShape.Metric metric, double target, long rampMillis, long holdMillis) A RAMP_HOLD shape usingRampCurve.LINEAR.static LoadShapespike(LoadShape.Metric metric, double baseline, double peak, long rampUpMillis, long holdMillis, long rampDownMillis) A SPIKE shape (no recovery hold).static LoadShapestairs(LoadShape.Metric metric, double start, double step, int steps, long stepDurationMillis) A STAIRS shape.withBaseline(Double baseline) withHoldMillis(Long holdMillis) withMetric(LoadShape.Metric metric) withRampDownMillis(Long rampDownMillis) withRampMillis(Long rampMillis) withRampUpMillis(Long rampUpMillis) withRecoveryHoldMillis(Long recoveryHoldMillis) withStepDurationMillis(Long stepDurationMillis) withTarget(Double target) withType(LoadShape.Type type) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode
-
Constructor Details
-
LoadShape
public LoadShape()
-
-
Method Details
-
loadShape
-
spike
public static LoadShape spike(LoadShape.Metric metric, double baseline, double peak, long rampUpMillis, long holdMillis, long rampDownMillis) A SPIKE shape (no recovery hold). -
stairs
public static LoadShape stairs(LoadShape.Metric metric, double start, double step, int steps, long stepDurationMillis) A STAIRS shape. -
rampHold
public static LoadShape rampHold(LoadShape.Metric metric, double target, long rampMillis, long holdMillis) A RAMP_HOLD shape usingRampCurve.LINEAR. -
getType
-
withType
-
getMetric
-
withMetric
-
getCurve
-
withCurve
-
getBaseline
-
withBaseline
-
getPeak
-
withPeak
-
getRampUpMillis
-
withRampUpMillis
-
getHoldMillis
-
withHoldMillis
-
getRampDownMillis
-
withRampDownMillis
-
getRecoveryHoldMillis
-
withRecoveryHoldMillis
-
getStart
-
withStart
-
getStep
-
withStep
-
getSteps
-
withSteps
-
getStepDurationMillis
-
withStepDurationMillis
-
getTarget
-
withTarget
-
getRampMillis
-
withRampMillis
-