16 releases (4 breaking)

new 0.5.2 Apr 24, 2024
0.5.1 Apr 19, 2024
0.4.0 Mar 5, 2024
0.3.2 Feb 28, 2024
0.1.0 Dec 4, 2023

#166 in Concurrency

Download history 4/week @ 2024-01-15 1/week @ 2024-01-22 8/week @ 2024-01-29 7/week @ 2024-02-05 189/week @ 2024-02-19 145/week @ 2024-02-26 120/week @ 2024-03-04 25/week @ 2024-03-11 10/week @ 2024-04-01 249/week @ 2024-04-15

259 downloads per month

MIT license

68KB
1.5K SLoC

Balter

Linux build status Crates.io

Balter, short for Balter, A Load TestER, is a load/stress testing framework designed to be flexible, efficient, and simple to use. Balter aims to minimize the conceptual overhead of load testing, and builds off of Tokio and the async ecosystem.

  • See the Website for an introduction to Balter.
  • See the Guide for a guide on how to get started.
  • See the Developer Notes section for tips on modifying Balter.

Example Usage

use balter::prelude::*;
use std::time::Duration;

#[tokio::main]
async fn main() {
    my_scenario()
        .tps(500)
        .error_rate(0.05)
        .latency(Duration::from_millis(20), 0.99)
        .duration(Duration::from_secs(30))
        .await;
}

#[scenario]
async fn my_scenario() {
    my_transaction().await;
}

#[transaction]
async fn my_transaction() -> Result<u32, String> {
    // Some request logic...

    Ok(0)
}

Developer Notes

The Balter repository is set up to be easy to get started with development. It uses Nix to facilitate the environment setup via shell.nix (if you haven't yet drank the Nixaide, open up that file and it will give you an idea of the programs you'll want). Otherwise, Balter works just fine with all the default cargo commands.

The integration tests can be a bit finicky. To run the integration tests, use just integration (or if you don't have just installed, cargo test --release --features integration). In order to easily debug these tests (which oftentimes rely on controller logic operating correctly), it can be useful to have graphs. You can find Grafana dashboards for each test in dashboards/, and if you have Prometheus running (using the prometheus.yml at the root) and Grafana running (importing the dashboards) you should be set.

Dependencies

~8–23MB
~304K SLoC