pub struct LoadScenario {
pub name: String,
pub template_type: Option<String>,
pub max_requests: Option<u64>,
pub start_delay_millis: Option<u64>,
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.
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 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 ==.