Expand description
§dev-stress
High-load stress testing for Rust. Concurrency, volume, saturation
under pressure. Part of the dev-* verification suite.
dev-stress is the answer to “does this code survive real load?”
Not “is it fast” (that’s dev-bench). Not “does it deadlock”
(that’s dev-async). Not “does it recover from failure” (that’s
dev-chaos).
§Quick example
use dev_stress::{Workload, StressRun};
#[derive(Clone)]
struct MyWorkload;
impl Workload for MyWorkload {
fn run_once(&self) {
std::hint::black_box(40 + 2);
}
}
let run = StressRun::new("hot_path")
.iterations(100_000)
.threads(8);
let result = run.execute(&MyWorkload);
let _check = result.into_check_result(None);§What’s measured
ops_per_sec— total iterations divided by total wall time.thread_time_cv— coefficient of variation across per-thread elapsed times. High CV indicates load imbalance or contention.latency_p50/p95/p99— per-operation latency percentiles (whenLatencyTrackeris enabled).
§Features
system-stats(opt-in): measure peak RSS and CPU time viasysinfo. Seesystem.
Re-exports§
pub use latency::LatencyStats;pub use latency::LatencyTracker;pub use soak::SoakCheckpoint;pub use soak::SoakResult;pub use soak::SoakRun;
Modules§
- latency
- Per-operation latency tracking for stress runs.
- soak
- Soak testing: run a workload for a sustained duration and capture ops/sec, latency, and degradation per checkpoint window.
- system
system-stats - System-level memory and CPU stats. Available with the
system-statsfeature.
Structs§
- Compare
Options - Options controlling how a
StressResultis compared against a baseline. - Stress
Producer - Producer wrapper that runs a stress run and emits a single-check
Report. - Stress
Result - Result of a stress run.
- Stress
Run - Configuration for a stress run.
Traits§
- Workload
- A workload that can be executed many times under stress.