pub struct LoadTestMetrics {
pub total_requests: u64,
pub successful_requests: u64,
pub failed_requests: u64,
pub bytes_sent: u64,
pub bytes_received: u64,
pub start_time: Option<Instant>,
pub end_time: Option<Instant>,
pub errors: Vec<String>,
/* private fields */
}Expand description
Load test metrics
Fields§
§total_requests: u64Total requests sent
successful_requests: u64Successful requests
failed_requests: u64Failed requests
bytes_sent: u64Total bytes sent
bytes_received: u64Total bytes received
start_time: Option<Instant>Start time
end_time: Option<Instant>End time
errors: Vec<String>Error messages
Implementations§
Source§impl LoadTestMetrics
impl LoadTestMetrics
Sourcepub fn record_success(
&mut self,
latency: Duration,
bytes_sent: usize,
bytes_received: usize,
)
pub fn record_success( &mut self, latency: Duration, bytes_sent: usize, bytes_received: usize, )
Record a successful request
Sourcepub fn record_failure(&mut self, error: String)
pub fn record_failure(&mut self, error: String)
Record a failed request
Sourcepub fn mark_started(&mut self)
pub fn mark_started(&mut self)
Mark test as started
Sourcepub fn mark_completed(&mut self)
pub fn mark_completed(&mut self)
Mark test as completed
Sourcepub fn requests_per_second(&self) -> f64
pub fn requests_per_second(&self) -> f64
Get requests per second
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get success rate
Sourcepub fn latency_stats(&self) -> LatencyStats
pub fn latency_stats(&self) -> LatencyStats
Get latency statistics
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print summary report
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 moreSource§impl Debug for LoadTestMetrics
impl Debug for LoadTestMetrics
Auto Trait Implementations§
impl Freeze for LoadTestMetrics
impl RefUnwindSafe for LoadTestMetrics
impl Send for LoadTestMetrics
impl Sync for LoadTestMetrics
impl Unpin for LoadTestMetrics
impl UnsafeUnpin for LoadTestMetrics
impl UnwindSafe for LoadTestMetrics
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