pub struct LoadScenario {
pub name: String,
pub template_type: Option<String>,
pub max_requests: Option<u64>,
pub start_delay_millis: Option<u64>,
pub thresholds: Vec<LoadThreshold>,
pub abort_on_fail: bool,
pub abort_grace_millis: Option<u64>,
pub pacing: Option<LoadPacing>,
pub feeder: Option<LoadFeeder>,
pub step_selection: Option<LoadStepSelection>,
pub profile: LoadProfile,
pub steps: Vec<LoadStep>,
}Expand description
An API-driven load scenario: ordered templated steps driven at a target
concurrency. Maps to the LoadScenario schema (the body of
PUT /mockserver/loadScenario, which registers the scenario in the
registry without running it). The unique name is the
registry key used by start/stop and the per-scenario GET/DELETE
endpoints.
Fields§
§name: StringHuman-readable scenario name.
template_type: Option<String>Template engine for per-iteration rendering — "VELOCITY" (default) or
"MUSTACHE". (JavaScript is rejected for load steps.)
max_requests: Option<u64>Optional hard cap on the total number of requests dispatched.
start_delay_millis: Option<u64>Optional delay (milliseconds) applied between a start request being
accepted and the scenario actually beginning to drive load. Honoured by
PUT /mockserver/loadScenario/start.
thresholds: Vec<LoadThreshold>Optional in-run pass/fail thresholds; the run carries a PASS verdict iff all hold, FAIL otherwise. Empty/omitted means no verdict is computed.
abort_on_fail: boolWhen true, a FAIL verdict aborts the run early. Default false (omitted).
abort_grace_millis: Option<u64>Suppress abort_on_fail for the first N milliseconds of the run so noisy
startup samples cannot trigger a premature abort.
pacing: Option<LoadPacing>Optional adaptive iteration pacing (closed-model VU loop only).
feeder: Option<LoadFeeder>Optional parameterized test data (a data feeder).
step_selection: Option<LoadStepSelection>How each iteration selects which steps to run — SEQUENTIAL (default,
omitted) or WEIGHTED.
profile: LoadProfileThe ramp profile.
steps: Vec<LoadStep>Ordered list of request steps fired in sequence each iteration (max 50).
Implementations§
Source§impl LoadScenario
impl LoadScenario
Sourcepub fn new(
name: impl Into<String>,
profile: LoadProfile,
steps: Vec<LoadStep>,
) -> Self
pub fn new( name: impl Into<String>, profile: LoadProfile, steps: Vec<LoadStep>, ) -> Self
Create a scenario with the given name, profile and steps.
Sourcepub fn threshold(self, threshold: LoadThreshold) -> Self
pub fn threshold(self, threshold: LoadThreshold) -> Self
Add an in-run pass/fail threshold.
Sourcepub fn abort_on_fail(self, abort_on_fail: bool) -> Self
pub fn abort_on_fail(self, abort_on_fail: bool) -> Self
Set whether a FAIL verdict aborts the run early.
Sourcepub fn abort_grace_millis(self, abort_grace_millis: u64) -> Self
pub fn abort_grace_millis(self, abort_grace_millis: u64) -> Self
Set the abort grace window (milliseconds) for abort_on_fail.
Sourcepub fn pacing(self, pacing: LoadPacing) -> Self
pub fn pacing(self, pacing: LoadPacing) -> Self
Set the adaptive iteration pacing.
Sourcepub fn feeder(self, feeder: LoadFeeder) -> Self
pub fn feeder(self, feeder: LoadFeeder) -> Self
Set the parameterized test data feeder.
Sourcepub fn step_selection(self, step_selection: LoadStepSelection) -> Self
pub fn step_selection(self, step_selection: LoadStepSelection) -> Self
Set how each iteration selects which steps to run.
Sourcepub fn template_type(self, template_type: impl Into<String>) -> Self
pub fn template_type(self, template_type: impl Into<String>) -> Self
Set the template engine ("VELOCITY" or "MUSTACHE").
Sourcepub fn max_requests(self, max_requests: u64) -> Self
pub fn max_requests(self, max_requests: u64) -> Self
Set the hard cap on total requests dispatched.
Sourcepub fn start_delay_millis(self, start_delay_millis: u64) -> Self
pub fn start_delay_millis(self, start_delay_millis: u64) -> Self
Set the delay (milliseconds) before the scenario begins driving load once started.
Trait Implementations§
Source§impl Clone for LoadScenario
impl Clone for LoadScenario
Source§fn clone(&self) -> LoadScenario
fn clone(&self) -> LoadScenario
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoadScenario
impl Debug for LoadScenario
Source§impl<'de> Deserialize<'de> for LoadScenario
impl<'de> Deserialize<'de> for LoadScenario
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LoadScenario
impl PartialEq for LoadScenario
Source§fn eq(&self, other: &LoadScenario) -> bool
fn eq(&self, other: &LoadScenario) -> bool
self and other values to be equal, and is used by ==.