{"id":46396617,"url":"https://github.com/karga-rs/karga","last_synced_at":"2026-03-05T10:01:45.343Z","repository":{"id":318309947,"uuid":"1048490385","full_name":"karga-rs/karga","owner":"karga-rs","description":"Load testing framework for rust","archived":false,"fork":false,"pushed_at":"2026-01-19T03:12:55.000Z","size":166,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-28T08:04:39.695Z","etag":null,"topics":["framework","load-testing","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/karga","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/karga-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T14:21:13.000Z","updated_at":"2026-02-25T17:56:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/karga-rs/karga","commit_stats":null,"previous_names":["outragedline/karga"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/karga-rs/karga","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karga-rs%2Fkarga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karga-rs%2Fkarga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karga-rs%2Fkarga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karga-rs%2Fkarga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karga-rs","download_url":"https://codeload.github.com/karga-rs/karga/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karga-rs%2Fkarga/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30118932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["framework","load-testing","rust"],"created_at":"2026-03-05T10:01:09.683Z","updated_at":"2026-03-05T10:01:45.327Z","avatar_url":"https://github.com/karga-rs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karga\n\n[![crates.io](https://img.shields.io/crates/v/karga.svg)](https://crates.io/crates/karga)\n\nA small, flexible **load-testing core** for Rust — think *serde* but for load testing. karga provides the building blocks (scenarios, executors, metrics, aggregates, reporters) and leaves the concrete implementations to you or your ecosystem: HTTP, Kafka, filesystem or CI integration can all live in separate crates that depend on `karga`.\n\n\u003e **Philosophy.** karga is built for composability and extensibility. The core exposes traits and tiny primitives so consumers can implement their own executors, metrics, reporters or even whole testing frameworks on top of karga. If you like how `serde` defines traits and lets others implement `serde_json` and `serde_yaml`, you'll feel at home.\n\n---\n\n## Table of contents\n\n* [Quickstart](#quickstart)\n* [Core concepts](#core-concepts)\n* [Example](#example)\n* [Design \u0026 extensibility](#design--extensibility)\n* [Roadmap](#roadmap)\n* [License](#license)\n* [Special Thanks](#special-thanks)\n\n---\n\n## Quickstart\n\nClone the repo and run the included example (the examples are intentionally minimal and focused on showing how to plug into karga — the `reqwest` HTTP example is just the easiest illustration):\n\n```bash\ngit clone https://github.com/karga-rs/karga.git\ncd karga\ncargo run --example http\n```\n\nThat example demonstrates measuring request latency and success (HTTP 200) using a simple executor. Replace the action with any async closure to exercise custom code (Kafka producer, filesystem workload, or any I/O you want).\n\n---\n\n## Core concepts\n\nThese are the primitives you will see in the codebase and should implement or compose with:\n\n  * **Scenario** — the high-level unit of a test. It ties together a name, an action (an async closure), and an executor.\n  * **Executor** — responsible for running the action (single-shot, looped, concurrent workers, etc.). Executors are intentionally externalized so you can provide different models.\n  * **Metric** — a single measurement returned by an action (latency, boolean success, bytes written, etc.).\n  * **Aggregate** — a way to combine many `Metric` values into summaries over time.\n  * **Report** — process aggregated metrics into useful data (such as percentiles)\n  * **Reporter** - sends a report somewhere: console, JSON/CSV export, HTTP endpoints, or integrations with monitoring systems.\n\nAll of these are trait-driven and designed for generics + composition.\n\n---\n\n## Example\n\nHere is a full, runnable example demonstrating a staged load test against an HTTP server.\n\n```rust\nuse std::time::{Duration, Instant};\n\nuse karga::{\n    Executor, Reporter, Scenario,\n    aggregate::BasicAggregate,\n    executor::{Stage, StageExecutor},\n    metric::BasicMetric,\n    report::{BasicReport, StdoutReporter},\n};\nuse reqwest::Client;\n\n#[tokio::main]\nasync fn main() {\n    tracing_subscriber::fmt().init();\n    // NEVER instantiate heavy things like clients inside the action\n    // unless you want to kill performance\n    let client = Client::new();\n\n    let results: BasicAggregate = StageExecutor::builder()\n        .stages(vec![\n            // Start with a ramp up from 0 to 10 over 3 seconds\n            Stage::new(Duration::from_secs(3), 10.0),\n            // Increase the rate of change to go from 10 to 100 over the\n            // next 3 seconds\n            Stage::new(Duration::from_secs(3), 100.0),\n            // ramp down from 100 to 10 over the next 3 sceonds\n            Stage::new(Duration::from_secs(3), 10.0),\n        ])\n        .build()\n        .exec(\n            \u0026Scenario::builder()\n                .name(\"Http scenario\")\n                .action(move || {\n                    let client = client.clone();\n                    async move {\n                        let start = Instant::now();\n\n                        // Yeah lets hardcode it\n                        let res = client.get(\"http://localhost:3000\").send().await;\n                        let success = match res {\n                            Ok(r) =\u003e r.status() == 200,\n                            Err(_) =\u003e false,\n                        };\n                        let elapsed = start.elapsed();\n                        BasicMetric {\n                            latency: elapsed,\n                            success,\n                            // We dont care about it in this example\n                            bytes: 0,\n                        }\n                    }\n                })\n                .build(),\n        )\n        .await\n        .unwrap();\n\n    let report = BasicReport::from(results);\n    // Thats quite strange syntax but whatever\n    StdoutReporter {}.report(\u0026report).await.unwrap();\n}\n```\n\nThe real `http` example in the repo shows a tiny `reqwest`-based action that records latency and a boolean success flag — use it as a starting point and swap the body for Kafka, gRPC or other protocols.\n\n---\n\n## Design \u0026 extensibility\n\n  * **Serde-like core** — karga focuses on representing the *what* (scenarios, metrics) and not the *how*. Implementations live in separate crates.\n  * **Generic-first API** — heavy use of traits and generics to make composing components ergonomic and zero-cost where possible.\n  * **Closure-driven actions** — define workloads as simple async closures so users can embed arbitrary logic without boilerplate.\n  * **Composable pipelines** — metrics flow from actions → aggregates → reports. Each stage is pluggable.\n\n### How to extend\n\n  * Implement the `Executor` trait to introduce a custom concurrency model (for example, worker pools that publish to Kafka).\n  * Implement a `Reporter` to ship results to your CI, log aggregator, or a custom dashboard.\n  * Write an `Metric` `Aggregate` and `Report` for some specific protocol or use case.\n\n---\n\n## Roadmap\n\nIdeas and possible future additions:\n\n  * official adapters / example crates for HTTP, gRPC, and filesystem workloads\n  * CI integration helpers and example GitHub Actions workflows\n  * official distributed executor\n\n\nIf you have a particular integration in mind (Kafka, Prometheus, a hosted service), I can help scaffold it.\n\n---\n\n## Contributing\n\nContributions welcome. Keep changes focused and idiomatic Rust. If you plan to publish a separate crate that depends on `karga`, feel free to go for it.\n\nPlease avoid using `karga` for attacks or illegal activity — this library is meant for development and testing only.\n\n---\n\n## License\n\n`karga` is MIT-licensed — see the `LICENSE` file in the repository.\n\n---\n\n## Special Thanks\n\n  * [k6](https://github.com/grafana/k6)\n  * [goose](https://github.com/tag1consulting/goose)\n  * [rlt](https://github.com/wfxr/rlt)\n  * [serde](https://github.com/serde-rs/serde)\n\nHuge thanks to those projects for ideas and inspiration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarga-rs%2Fkarga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarga-rs%2Fkarga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarga-rs%2Fkarga/lists"}