Package org.mockserver.load
Class LoadStage
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.load.LoadStage
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 holdsvusor ramps fromstartVustoendVusalong thecurve.LoadStageType.RATE— open model. Either holdsrateor ramps fromstartRatetoendRate(iterations/second) along thecurve, optionally capped atmaxVusvirtual users for this stage (else the global VU cap).LoadStageType.PAUSE— drives no load fordurationMillis.
targetVusAt(long) and targetRateAt(long) are the pure, deterministic setpoint
functions the orchestrator reads each control tick; both honour the curve.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadStageconstantRate(double rate, long durationMillis) static LoadStageconstantVus(int vus, long durationMillis) getCurve()longgetRate()getType()getVus()booleanTrue when this RATE stage is a ramp (both start and end rate supplied), else a hold.booleanisVuRamp()True when this VU stage is a ramp (both start and end VUs supplied), else a hold.static LoadStagestatic LoadStagepause(long durationMillis) doublepeakRate()The largest arrival rate this stage can request (used to enforce the rate cap up-front).intpeakVus()The largest VU count this stage can request (used to enforce the VU cap up-front regardless of shape).static LoadStagerampRate(double startRate, double endRate, long durationMillis) static LoadStagestatic LoadStagerampVus(int startVus, int endVus, long durationMillis) static LoadStagedoubletargetRateAt(long elapsedInStageMillis) The target arrival rate (iterations/second) atelapsedInStageMillisinto this RATE stage.inttargetVusAt(long elapsedInStageMillis) The target VU setpoint atelapsedInStageMillisinto this VU stage.withDurationMillis(long durationMillis) withEndRate(Double endRate) withEndVus(Integer endVus) withMaxVus(Integer maxVus) withStartRate(Double startRate) withStartVus(Integer startVus) withType(LoadStageType type) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode
-
Constructor Details
-
LoadStage
public LoadStage()
-
-
Method Details
-
loadStage
-
constantVus
-
rampVus
-
rampVus
-
constantRate
-
rampRate
-
rampRate
-
pause
-
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 atelapsedInStageMillisinto this VU stage. For a hold this isvus; for a ramp it isround(curve.valueAt(startVus, endVus, progress)). Returns0for non-VU stages. -
targetRateAt
public double targetRateAt(long elapsedInStageMillis) The target arrival rate (iterations/second) atelapsedInStageMillisinto this RATE stage. For a hold this israte; for a ramp it iscurve.valueAt(startRate, endRate, progress). Returns0for 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
-
withType
-
getDurationMillis
public long getDurationMillis() -
withDurationMillis
-
getCurve
-
withCurve
-
getVus
-
withVus
-
getStartVus
-
withStartVus
-
getEndVus
-
withEndVus
-
getRate
-
withRate
-
getStartRate
-
withStartRate
-
getEndRate
-
withEndRate
-
getMaxVus
-
withMaxVus
-