pub struct TestMetrics {
pub name: String,
pub timings_ns: Vec<u64>,
pub op_counts: HashMap<String, u64>,
pub custom_metrics: HashMap<String, f64>,
pub memory_samples: Vec<usize>,
pub error_count: u64,
pub warning_count: u64,
/* private fields */
}Expand description
Granular performance metrics for test operations.
Fields§
§name: StringOperation name for reporting
timings_ns: Vec<u64>Individual timing samples (nanoseconds)
op_counts: HashMap<String, u64>Operation counts by category
custom_metrics: HashMap<String, f64>Custom numeric metrics
memory_samples: Vec<usize>Memory snapshots (bytes)
error_count: u64Error/warning counts
warning_count: u64Implementations§
Source§impl TestMetrics
impl TestMetrics
Sourcepub fn start_timing(&mut self)
pub fn start_timing(&mut self)
Start timing measurement.
Sourcepub fn stop_timing(&mut self)
pub fn stop_timing(&mut self)
Stop timing and record sample.
Sourcepub fn time_operation<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce() -> R,
pub fn time_operation<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce() -> R,
Record a timed operation with closure.
Sourcepub fn record_operation(&mut self, count: u64)
pub fn record_operation(&mut self, count: u64)
Record operation count.
Sourcepub fn record_metric(&mut self, name: &str, value: f64)
pub fn record_metric(&mut self, name: &str, value: f64)
Record custom metric.
Sourcepub fn record_memory(&mut self, bytes: usize)
pub fn record_memory(&mut self, bytes: usize)
Record memory usage.
Sourcepub fn record_error(&mut self)
pub fn record_error(&mut self)
Record an error.
Sourcepub fn record_warning(&mut self)
pub fn record_warning(&mut self)
Record a warning.
Sourcepub fn timing_stats(&self) -> TimingStats
pub fn timing_stats(&self) -> TimingStats
Get timing statistics.
Trait Implementations§
Source§impl Clone for TestMetrics
impl Clone for TestMetrics
Source§fn clone(&self) -> TestMetrics
fn clone(&self) -> TestMetrics
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 TestMetrics
impl RefUnwindSafe for TestMetrics
impl Send for TestMetrics
impl Sync for TestMetrics
impl Unpin for TestMetrics
impl UnwindSafe for TestMetrics
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