pub struct HttpChaosProfile {Show 25 fields
pub error_status: Option<u16>,
pub error_probability: Option<f64>,
pub latency: Option<Delay>,
pub connection_drop: Option<bool>,
pub seed: Option<i64>,
pub retry_after: Option<String>,
pub drop_connection_probability: Option<f64>,
pub succeed_first: Option<i64>,
pub fail_request_count: Option<i64>,
pub outage_after_millis: Option<i64>,
pub outage_duration_millis: Option<i64>,
pub truncate_body_at_fraction: Option<f64>,
pub malformed_body: Option<bool>,
pub slow_response_chunk_size: Option<i64>,
pub slow_response_chunk_delay: Option<Delay>,
pub quota_name: Option<String>,
pub quota_limit: Option<i64>,
pub quota_window_millis: Option<i64>,
pub quota_error_status: Option<u16>,
pub degradation_ramp_millis: Option<i64>,
pub graphql_errors: Option<bool>,
pub graphql_error_message: Option<String>,
pub graphql_error_code: Option<String>,
pub graphql_nullify_data: Option<bool>,
pub extra: HashMap<String, Value>,
}Expand description
An HTTP chaos / fault-injection profile for a host or expectation. Maps to
the HttpChaosProfile schema. Captures the commonly-used fields; the model
carries an extra map for any additional server-supported keys.
Fields§
§error_status: Option<u16>HTTP error status code to return instead of the real response.
error_probability: Option<f64>Probability (0.0–1.0) that a request triggers the error.
latency: Option<Delay>Injected latency (a Delay).
connection_drop: Option<bool>When true, drops the TCP connection without responding.
seed: Option<i64>Fixed seed for deterministic probabilistic outcomes.
retry_after: Option<String>Literal Retry-After header value returned with an injected error.
drop_connection_probability: Option<f64>Probability (0.0–1.0) of dropping the TCP connection without responding.
succeed_first: Option<i64>Let the first N requests succeed before chaos becomes active.
fail_request_count: Option<i64>Number of requests to fail once chaos is active.
outage_after_millis: Option<i64>Time-based outage: chaos activates this many ms after first match.
outage_duration_millis: Option<i64>Time-based outage: chaos stays active this many ms then self-heals.
truncate_body_at_fraction: Option<f64>Keep only this leading fraction (0.0–1.0) of the response body.
malformed_body: Option<bool>Corrupt the response body so it fails to parse.
slow_response_chunk_size: Option<i64>Dribble the response body in chunks of this many bytes.
slow_response_chunk_delay: Option<Delay>Delay between slow-response chunks.
quota_name: Option<String>Shared quota counter key.
quota_limit: Option<i64>Max requests allowed per quota window.
quota_window_millis: Option<i64>Quota fixed-window length in milliseconds.
quota_error_status: Option<u16>Status returned when the quota is exceeded (default 429).
degradation_ramp_millis: Option<i64>Ramp error/drop probabilities linearly over this many ms from first match.
graphql_errors: Option<bool>Rewrite the response body as a GraphQL error envelope.
graphql_error_message: Option<String>Message in errors[0].message of the GraphQL error envelope.
graphql_error_code: Option<String>Value for errors[0].extensions.code.
graphql_nullify_data: Option<bool>Whether data is null (default true) in the GraphQL error envelope.
extra: HashMap<String, Value>Any additional fields the server supports that are not modelled above.
Implementations§
Source§impl HttpChaosProfile
impl HttpChaosProfile
Sourcepub fn error_status(self, status: u16) -> Self
pub fn error_status(self, status: u16) -> Self
Set the error status code returned on fault.
Sourcepub fn error_probability(self, probability: f64) -> Self
pub fn error_probability(self, probability: f64) -> Self
Set the probability (0.0–1.0) of triggering the error.
Sourcepub fn connection_drop(self, drop: bool) -> Self
pub fn connection_drop(self, drop: bool) -> Self
Drop the TCP connection without responding.
Trait Implementations§
Source§impl Clone for HttpChaosProfile
impl Clone for HttpChaosProfile
Source§fn clone(&self) -> HttpChaosProfile
fn clone(&self) -> HttpChaosProfile
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 HttpChaosProfile
impl Debug for HttpChaosProfile
Source§impl Default for HttpChaosProfile
impl Default for HttpChaosProfile
Source§fn default() -> HttpChaosProfile
fn default() -> HttpChaosProfile
Source§impl<'de> Deserialize<'de> for HttpChaosProfile
impl<'de> Deserialize<'de> for HttpChaosProfile
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 HttpChaosProfile
impl PartialEq for HttpChaosProfile
Source§fn eq(&self, other: &HttpChaosProfile) -> bool
fn eq(&self, other: &HttpChaosProfile) -> bool
self and other values to be equal, and is used by ==.