pub struct SoakResult {
pub name: String,
pub iterations: usize,
pub threads: usize,
pub total_elapsed: Duration,
pub thread_times: Vec<Duration>,
pub latency: Option<LatencyStats>,
pub checkpoints: Vec<SoakCheckpoint>,
}Expand description
Result of a soak run.
§Example
use dev_stress::{SoakRun, Workload};
use std::time::Duration;
#[derive(Clone)]
struct Noop;
impl Workload for Noop { fn run_once(&self) {} }
let r = SoakRun::new("steady")
.duration(Duration::from_millis(50))
.checkpoint(Duration::from_millis(10))
.threads(1)
.execute(&Noop);
assert!(!r.checkpoints.is_empty());Fields§
§name: StringStable name of the run.
iterations: usizeTotal iterations across all threads.
threads: usizeThreads used.
total_elapsed: DurationWall-clock duration of the soak.
thread_times: Vec<Duration>Per-thread elapsed times.
latency: Option<LatencyStats>Aggregate latency stats across the whole run.
checkpoints: Vec<SoakCheckpoint>Per-window checkpoints captured during the soak.
Implementations§
Source§impl SoakResult
impl SoakResult
Sourcepub fn ops_per_sec(&self) -> f64
pub fn ops_per_sec(&self) -> f64
Effective throughput in operations per second across the whole soak.
Sourcepub fn checkpoint_ops_cv(&self) -> f64
pub fn checkpoint_ops_cv(&self) -> f64
Coefficient of variation of ops_per_sec across checkpoints.
High values indicate the workload is degrading or fluctuating over time; low values indicate steady state.
Sourcepub fn into_check_result(self, degradation_pct_threshold: f64) -> CheckResult
pub fn into_check_result(self, degradation_pct_threshold: f64) -> CheckResult
Convert this result into a CheckResult.
Default verdict logic:
- No checkpoints (or only one) ->
Skipwith detail. degradation_pct_thresholdexceeded between first-half and second-half mean ops/sec ->Fail+Warning.- Otherwise
Pass.
Always carries the stress and soak tags plus numeric
evidence for iterations, threads, ops_per_sec,
total_elapsed_ms, checkpoint_count, checkpoint_ops_cv,
first_half_ops, second_half_ops.
Trait Implementations§
Source§impl Clone for SoakResult
impl Clone for SoakResult
Source§fn clone(&self) -> SoakResult
fn clone(&self) -> SoakResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SoakResult
impl RefUnwindSafe for SoakResult
impl Send for SoakResult
impl Sync for SoakResult
impl Unpin for SoakResult
impl UnsafeUnpin for SoakResult
impl UnwindSafe for SoakResult
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