pub struct LoadTestMetrics {Show 13 fields
pub total_operations: u64,
pub successful_operations: u64,
pub failed_operations: u64,
pub latencies: Vec<Duration>,
pub start_time: Instant,
pub bytes_sent: u64,
pub bytes_received: u64,
pub cpu_usage: Vec<f32>,
pub memory_usage: Vec<u64>,
pub concurrent_connections: Vec<u32>,
pub throughput_samples: Vec<f64>,
pub error_types: HashMap<String, u32>,
pub latency_percentiles: HashMap<String, Duration>,
}Expand description
Load test metrics with comprehensive monitoring
Fields§
§total_operations: u64§successful_operations: u64§failed_operations: u64§latencies: Vec<Duration>§start_time: Instant§bytes_sent: u64§bytes_received: u64§cpu_usage: Vec<f32>§memory_usage: Vec<u64>§concurrent_connections: Vec<u32>§throughput_samples: Vec<f64>§error_types: HashMap<String, u32>§latency_percentiles: HashMap<String, Duration>Implementations§
Source§impl LoadTestMetrics
impl LoadTestMetrics
pub fn new() -> Self
pub fn success_rate(&self) -> f64
pub fn average_latency(&self) -> Duration
pub fn throughput(&self, duration: Duration) -> f64
Sourcepub fn calculate_percentiles(&mut self)
pub fn calculate_percentiles(&mut self)
Calculate latency percentiles
Sourcepub fn record_error(&mut self, error_type: &str)
pub fn record_error(&mut self, error_type: &str)
Record error by type
Sourcepub fn record_success(
&mut self,
latency: Duration,
bytes_sent: u64,
bytes_received: u64,
)
pub fn record_success( &mut self, latency: Duration, bytes_sent: u64, bytes_received: u64, )
Record successful operation with data transfer
Sourcepub fn record_failure(&mut self, latency: Duration, error_type: String)
pub fn record_failure(&mut self, latency: Duration, error_type: String)
Record failed operation
Sourcepub fn record_system_metrics(
&mut self,
cpu_usage: f32,
memory_usage: u64,
connections: u32,
)
pub fn record_system_metrics( &mut self, cpu_usage: f32, memory_usage: u64, connections: u32, )
Record system metrics
Sourcepub fn record_throughput_sample(&mut self, throughput: f64)
pub fn record_throughput_sample(&mut self, throughput: f64)
Record throughput sample
Sourcepub fn average_cpu_usage(&self) -> f32
pub fn average_cpu_usage(&self) -> f32
Get average CPU usage
Sourcepub fn peak_memory_usage(&self) -> u64
pub fn peak_memory_usage(&self) -> u64
Get peak memory usage
Sourcepub fn network_throughput(&self, duration: Duration) -> (f64, f64)
pub fn network_throughput(&self, duration: Duration) -> (f64, f64)
Get network throughput (bytes per second)
Trait Implementations§
Source§impl Clone for LoadTestMetrics
impl Clone for LoadTestMetrics
Source§fn clone(&self) -> LoadTestMetrics
fn clone(&self) -> LoadTestMetrics
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 moreAuto Trait Implementations§
impl Freeze for LoadTestMetrics
impl RefUnwindSafe for LoadTestMetrics
impl Send for LoadTestMetrics
impl Sync for LoadTestMetrics
impl Unpin for LoadTestMetrics
impl UnwindSafe for LoadTestMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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