pub struct MetricsBucket {Show 13 fields
pub timestamp: DateTime<Utc>,
pub bucket: TimeBucket,
pub total_events: usize,
pub events_by_type: HashMap<String, usize>,
pub avg_latency_ms: f64,
pub max_latency_ms: u64,
pub min_latency_ms: u64,
pub total_faults: usize,
pub faults_by_type: HashMap<String, usize>,
pub rate_limit_violations: usize,
pub traffic_shaping_events: usize,
pub protocol_events: HashMap<String, usize>,
pub affected_endpoints: HashMap<String, usize>,
}Expand description
Aggregated chaos metrics for a time bucket
Fields§
§timestamp: DateTime<Utc>Bucket timestamp
bucket: TimeBucketBucket size
total_events: usizeTotal events in this bucket
events_by_type: HashMap<String, usize>Events by type
avg_latency_ms: f64Average latency (ms)
max_latency_ms: u64Max latency (ms)
min_latency_ms: u64Min latency (ms)
total_faults: usizeTotal faults injected
faults_by_type: HashMap<String, usize>Faults by type
rate_limit_violations: usizeRate limit violations
traffic_shaping_events: usizeTraffic shaping events
protocol_events: HashMap<String, usize>Protocol events
affected_endpoints: HashMap<String, usize>Affected endpoints
Implementations§
Source§impl MetricsBucket
impl MetricsBucket
Sourcepub fn new(timestamp: DateTime<Utc>, bucket: TimeBucket) -> Self
pub fn new(timestamp: DateTime<Utc>, bucket: TimeBucket) -> Self
Create a new empty metrics bucket
Sourcepub fn add_event(&mut self, event: &ChaosEvent)
pub fn add_event(&mut self, event: &ChaosEvent)
Add an event to this bucket
Trait Implementations§
Source§impl Clone for MetricsBucket
impl Clone for MetricsBucket
Source§fn clone(&self) -> MetricsBucket
fn clone(&self) -> MetricsBucket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricsBucket
impl Debug for MetricsBucket
Source§impl<'de> Deserialize<'de> for MetricsBucket
impl<'de> Deserialize<'de> for MetricsBucket
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MetricsBucket
impl RefUnwindSafe for MetricsBucket
impl Send for MetricsBucket
impl Sync for MetricsBucket
impl Unpin for MetricsBucket
impl UnwindSafe for MetricsBucket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request