AutoBalter

Automatic load testing and performance analysis.

Full confidence in your system with just an API spec.

Learn more!

Balter-rs

The composable distributed load testing framework.

Open Source under the MIT License.

Star Fork
Learn more!
use balter::prelude::*;

#[tokio::main]
async fn main() {
    tokio::join! {
        async {
            // First, set up a background load which either hits
            // 10K TPS, has a p95 latency of 200ms or has an
            // error rate of 5%
            set_background_load()
                .tps(10_000)
                .latency(Duration::from_millis(200), 0.95)
                .error_rate(0.05)
                .await;
        },
        async {
            // After 300s of waiting, test our scaling ability
            // by running a scenario which achieves either
            // 100K TPS or a p90 latency of 1,000ms
            sleep(Duration::from_secs(300)).await;

            test_scaling_functionality()
                .tps(100_000)
                .latency(Duration::from_millis(1_000), 0.90)
                .duration(Duration::from_secs(3600))
                .await;
        },
    }
}