{"id":13467782,"url":"https://github.com/wfxr/rlt","last_synced_at":"2025-04-05T09:08:59.707Z","repository":{"id":231672333,"uuid":"776341181","full_name":"wfxr/rlt","owner":"wfxr","description":"A universal load testing framework for Rust, with real-time tui support.","archived":false,"fork":false,"pushed_at":"2024-08-26T20:17:26.000Z","size":299,"stargazers_count":146,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-03T09:18:27.739Z","etag":null,"topics":["benchmark","cli","load-testing","performance","rust","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wfxr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"wfxr"}},"created_at":"2024-03-23T08:32:38.000Z","updated_at":"2024-10-27T21:15:14.000Z","dependencies_parsed_at":"2024-04-14T04:19:19.511Z","dependency_job_id":"43e6bccd-2982-4ee1-953b-29f6d16910ab","html_url":"https://github.com/wfxr/rlt","commit_stats":null,"previous_names":["wfxr/rlt"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfxr%2Frlt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfxr%2Frlt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfxr%2Frlt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfxr%2Frlt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wfxr","download_url":"https://codeload.github.com/wfxr/rlt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312082,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","cli","load-testing","performance","rust","tui"],"created_at":"2024-07-31T15:01:00.471Z","updated_at":"2025-04-05T09:08:59.655Z","avatar_url":"https://github.com/wfxr.png","language":"Rust","readme":"# rlt\n\n\nA **R**ust **L**oad **T**esting framework with real-time tui support.\n\n[![Crates.io](https://img.shields.io/crates/v/rlt.svg)](https://crates.io/crates/rlt)\n[![Documentation](https://docs.rs/rlt/badge.svg)](https://docs.rs/rlt/)\n[![Dependency status](https://deps.rs/repo/github/wfxr/rlt/status.svg)](https://deps.rs/repo/github/wfxr/rlt)\n[![License](https://img.shields.io/crates/l/csview.svg)](https://github.com/wfxr/rlt?tab=MIT-1-ov-file)\n\n![Screenshot](https://raw.githubusercontent.com/wfxr/i/master/rlt-demo.gif)\n\n**rlt** provides a simple way to create load test tools in Rust.\nIt is designed to be a universal load test framework, which means you can use\nrlt for various services, such as Http, gRPC, Thrift, Database, or other customized services.\n\n### Features\n\n- **Flexible**: Customize the work load with your own logic.\n- **Easy to use**: Little boilerplate code, just focus on testing.\n- **Rich Statistics**: Collect and display rich statistics.\n- **High performance**: Optimized for performance and resource usage.\n- **Real-time TUI**: Monitor testing progress with a powerful real-time TUI.\n\n### Quick Start\n\nRun `cargo add rlt` to add `rlt` as a dependency to your `Cargo.toml`:\n\n```toml\n[dependencies]\nrlt = \"0.1.1\"\n```\n\nThen create your bench suite by implementing the `BenchSuite` trait.\n`flatten` attribute can be used to embed the predefined `BenchCli` into your own.\n\n```rust\n#[derive(Parser, Clone)]\npub struct HttpBench {\n    /// Target URL.\n    pub url: Url,\n\n    /// Embed BenchCli into this Opts.\n    #[command(flatten)]\n    pub bench_opts: BenchCli,\n}\n\n#[async_trait]\nimpl BenchSuite for HttpBench {\n    type WorkerState = Client;\n\n    async fn state(\u0026self, _: u32) -\u003e Result\u003cSelf::WorkerState\u003e {\n        Ok(Client::new())\n    }\n\n    async fn bench(\u0026mut self, client: \u0026mut Self::WorkerState, _: \u0026IterInfo) -\u003e Result\u003cIterReport\u003e {\n        let t = Instant::now();\n        let resp = client.get(self.url.clone()).send().await?;\n        let status = resp.status().into();\n        let bytes = resp.bytes().await?.len() as u64;\n        let duration = t.elapsed();\n        Ok(IterReport { duration, status, bytes, items: 1 })\n    }\n}\n```\n\n*You can also create a separate struct to hold the cli options for more flexibility. There is an example in [examples/http_hyper.rs](examples/http_hyper.rs).*\n\nFinally, create the main function to run the load test:\n\n```rust\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    let bs = HttpBench::parse();\n    rlt::cli::run(bs.bench_opts, bs).await\n}\n```\n\nMore examples can be found in the [examples](examples) directory.\n\n### Credits\n\nThe TUI layout in rlt is inspired by [oha](https://github.com/hatoo/oha).\n\n### License\n\n`rlt` is distributed under the terms of both the MIT License and the Apache License 2.0.\n\nSee the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.\n","funding_links":["https://ko-fi.com/wfxr"],"categories":["Rust","Development tools"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfxr%2Frlt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwfxr%2Frlt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfxr%2Frlt/lists"}