You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Rust Load Testing framework with real-time tui support.
rlt provides a simple way to create load test tools in Rust.
It is designed to be a universal load test framework, which means you can use
rlt for various services, such as Http, gRPC, Thrift, Database, or other customized services.
Features
Flexible: Customize the work load with your own logic.
Easy to use: Little boilerplate code, just focus on testing.
Rich Statistics: Collect and display rich statistics.
High performance: Optimized for performance and resource usage.
Real-time TUI: Monitor testing progress with a powerful real-time TUI.
Quick Start
Run cargo add rlt to add rlt as a dependency to your Cargo.toml:
[dependencies]
rlt = "0.1.1"
Then create your bench suite by implementing the BenchSuite trait.
flatten attribute can be used to embed the predefined BenchCli into your own.
#[derive(Parser,Clone)]pubstructHttpBench{/// Target URL.puburl:Url,/// Embed BenchCli into this Opts.#[command(flatten)]pubbench_opts:BenchCli,}#[async_trait]implBenchSuiteforHttpBench{typeWorkerState = Client;asyncfnstate(&self, _:u32) -> Result<Self::WorkerState>{Ok(Client::new())}asyncfnbench(&mutself,client:&mutSelf::WorkerState, _:&IterInfo) -> Result<IterReport>{let t = Instant::now();let resp = client.get(self.url.clone()).send().await?;let status = resp.status().into();let bytes = resp.bytes().await?.len()asu64;let duration = t.elapsed();Ok(IterReport{ duration, status, bytes,items:1})}}
You can also create a separate struct to hold the cli options for more flexibility. There is an example in examples/http_hyper.rs.
Finally, create the main function to run the load test: