Skip to main content

Crate dev_stress

Crate dev_stress 

Source
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 (when LatencyTracker is enabled).

§Features

  • system-stats (opt-in): measure peak RSS and CPU time via sysinfo. See system.

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.
systemsystem-stats
System-level memory and CPU stats. Available with the system-stats feature.

Structs§

CompareOptions
Options controlling how a StressResult is compared against a baseline.
StressProducer
Producer wrapper that runs a stress run and emits a single-check Report.
StressResult
Result of a stress run.
StressRun
Configuration for a stress run.

Traits§

Workload
A workload that can be executed many times under stress.