pub struct SimulatorStats {
pub requests_total: u64,
pub requests_success: u64,
pub requests_failed: u64,
pub requests_timeout: u64,
pub bytes_sent: u64,
pub bytes_received: u64,
pub total_latency_ms: f64,
pub endpoint_counts: HashMap<String, u64>,
}Expand description
Statistics tracked by simulators
Fields§
§requests_total: u64§requests_success: u64§requests_failed: u64§requests_timeout: u64§bytes_sent: u64§bytes_received: u64§total_latency_ms: f64§endpoint_counts: HashMap<String, u64>Implementations§
Source§impl SimulatorStats
impl SimulatorStats
pub fn avg_latency_ms(&self) -> f64
pub fn record_request(&mut self, endpoint: &str, success: bool, latency_ms: f64)
pub fn record_timeout(&mut self)
pub fn record_bytes(&mut self, sent: u64, received: u64)
Trait Implementations§
Source§impl Clone for SimulatorStats
impl Clone for SimulatorStats
Source§fn clone(&self) -> SimulatorStats
fn clone(&self) -> SimulatorStats
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 SimulatorStats
impl Debug for SimulatorStats
Source§impl Default for SimulatorStats
impl Default for SimulatorStats
Source§fn default() -> SimulatorStats
fn default() -> SimulatorStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SimulatorStats
impl<'de> Deserialize<'de> for SimulatorStats
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 SimulatorStats
impl RefUnwindSafe for SimulatorStats
impl Send for SimulatorStats
impl Sync for SimulatorStats
impl Unpin for SimulatorStats
impl UnsafeUnpin for SimulatorStats
impl UnwindSafe for SimulatorStats
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