Package org.mockserver.load
Class LoadScenario
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.load.LoadScenario
An API-driven load scenario: an ordered list of templated request
LoadSteps
driven at a target concurrency described by a LoadProfile, with optional
per-iteration data variation via the scenario's HttpTemplate.TemplateType.
Modelled on VerificationSequence (an ordered list of
request steps) but oriented at producing traffic rather than asserting over it.
It is a pure SLI producer: it records latency/error samples (into the metrics histograms
and the SLO sample store) but contains no verdict logic — the SLO verify feature consumes
those samples.
Off by default; PUT /mockserver/loadScenario returns 403 unless
loadGenerationEnabled is set.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow each iteration selects which steps to run fromgetSteps(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongThe abort grace window in milliseconds (default0).The data feeder (may be null = no feeder).Scenario-level custom labels (may be null/empty).getName()Adaptive iteration pacing (may be null = no pacing).longThe start delay in milliseconds applied after a start trigger before this scenario's iterations begin (default0).getSteps()The per-iteration step selection mode (may be null =LoadScenario.StepSelection.SEQUENTIAL).In-run pass/fail thresholds (may be null/empty).booleanWhether aFAILverdict aborts the run early (defaultfalse).static LoadScenariostatic LoadScenarioloadScenario(String name) withAbortGraceMillis(long abortGraceMillis) withAbortOnFail(boolean abortOnFail) withFeeder(LoadFeeder feeder) withLabels(Map<String, String> labels) withMaxRequests(Integer maxRequests) withPacing(LoadPacing pacing) withProfile(LoadProfile profile) withStartDelayMillis(long startDelayMillis) withStepSelection(LoadScenario.StepSelection stepSelection) withTemplateType(HttpTemplate.TemplateType templateType) withThresholds(List<LoadThreshold> thresholds) withThresholds(LoadThreshold... thresholds) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode
-
Constructor Details
-
LoadScenario
public LoadScenario()
-
-
Method Details
-
loadScenario
-
loadScenario
-
getName
-
withName
-
getSteps
-
withSteps
-
withSteps
-
getProfile
-
withProfile
-
getTemplateType
-
withTemplateType
-
getMaxRequests
-
withMaxRequests
-
getStartDelayMillis
public long getStartDelayMillis()The start delay in milliseconds applied after a start trigger before this scenario's iterations begin (default0). SeestartDelayMillis. -
withStartDelayMillis
-
getLabels
Scenario-level custom labels (may be null/empty). Seelabels. -
withLabels
-
withLabel
-
getThresholds
In-run pass/fail thresholds (may be null/empty). Seethresholds. -
withThresholds
-
withThresholds
-
isAbortOnFail
public boolean isAbortOnFail()Whether aFAILverdict aborts the run early (defaultfalse). SeeabortOnFail. -
withAbortOnFail
-
getAbortGraceMillis
public long getAbortGraceMillis()The abort grace window in milliseconds (default0). SeeabortGraceMillis. -
withAbortGraceMillis
-
getPacing
Adaptive iteration pacing (may be null = no pacing). Seepacing. -
withPacing
-
getFeeder
The data feeder (may be null = no feeder). Seefeeder. -
withFeeder
-
getStepSelection
The per-iteration step selection mode (may be null =LoadScenario.StepSelection.SEQUENTIAL). SeestepSelection. -
withStepSelection
-