What it does
dev-stress measures how a workload behaves when scaled up: thousands
of concurrent operations, millions of iterations, sustained pressure.
It detects:
- Throughput collapse under concurrency
- Lock contention (via thread-time variance)
- Latency cliff-falls
- Sustained-load instability
It does NOT do:
- Single-threaded micro-benchmarking (use
dev-bench) - Async-specific issue detection (use
dev-async) - Failure injection (use
dev-chaos)
Quick start
[]
= "0.9"
use ;
;
let run = new
.iterations
.threads;
let result = run.execute;
println!;
println!;
let _check = result.into_check_result;
The returned CheckResult carries the stress tag and numeric
Evidence for iterations, threads, ops_per_sec,
thread_time_cv, and total_elapsed_ms — no detail-string parsing.
Per-op latency percentiles
Track p50/p95/p99 per operation by enabling latency tracking:
use ;
;
let run = new
.iterations
.threads
.track_latency; // 10% sampling
let r = run.execute;
if let Some = &r.latency
Configurable thresholds
use ;
use Duration;
;
let r = new.iterations.threads
.track_latency
.execute;
let opts = CompareOptions ;
let _check = r.compare_with_options;
Soak tests
Run a workload for sustained duration and detect degradation across checkpoints:
use ;
use Duration;
;
let r = new
.duration
.checkpoint
.threads
.track_latency
.execute;
// Fail if second-half mean ops/sec drops more than 15% below first half.
let _check = r.into_check_result;
Producer trait
use ;
use Producer;
;
let producer = new;
let report = producer.produce; // dev_report::Report
System stats (opt-in)
[]
= { = "0.9", = ["system-stats"] }
use ;
let mut sampler = new;
let before = sampler.sample.unwrap;
// ... run workload ...
let after = sampler.sample.unwrap;
let _check = compare;
Thread-time CV
The coefficient of variation across thread elapsed times is the clearest signal that a workload is contention-bound:
- CV near 0: threads finished at nearly the same time. Healthy.
- CV > 0.2: significant variance. Some threads were waiting on locks or contended resources.
- CV > 0.5: severe contention. Investigate.
Status
v0.9.x is the pre-1.0 stabilization line. APIs are expected to be
near-final; minor adjustments may still happen ahead of 1.0. The
statistic definitions (ops_per_sec, thread_time_cv) are pinned
and will not change.
Minimum supported Rust version
1.85 — pinned in Cargo.toml via rust-version and verified by
the MSRV job in CI. (Bumped from 1.75 to align with the suite's
shared MSRV after sibling crates picked up dependencies that require
edition2024.)
License
Apache-2.0. See LICENSE.