rustress 0.1.1

High-performance load testing engine with an interactive terminal dashboard. Open-loop (RPS) and closed-loop (virtual users) load models with live p50/p90/p95/p99 latency telemetry.
Documentation
use anyhow::Result;
use clap::Parser;
use rustress::cli::args::{Cli, Commands};
use rustress::cli::commands;

#[tokio::main]
async fn main() -> Result<()> {
    let cli = Cli::parse();

    match cli.command {
        Some(Commands::Dummy { port }) => {
            commands::dummy::run(port).await?;
        }
        Some(Commands::Report { input }) => {
            commands::report::run(&input)?;
        }
        None => {
            let cfg = cli.into_config();

            if cfg.url.is_empty() && cfg.command.is_none() {
                commands::tui_mode::run_tui(cfg).await?;
            } else {
                commands::headless::run_headless(cfg).await?;
            }
        }
    }

    Ok(())
}