relentless/
lib.rs

1//! Relentless load testing and comparison testing tool for HTTP / GRPC.
2//!
3//! # Usage
4//! Main usage of `relentless` is comparison testing for REST API servers with `relentless-http`.
5//! Other usages in [More details](#more-details) section.
6//!
7//! ## Install
8//! ```sh
9//! cargo install --git https://github.com/hayas1/relentless relentless-http --features cli
10//! ```
11//! or get binary from [GitHub Releases](https://github.com/hayas1/relentless/releases).
12//!
13//! ## Prepare Config
14//! For example, `compare.yaml`
15//! ```yaml
16//! name: basic comparison test
17//! destinations:
18//!   actual: http://localhost:3000
19//!   expect: http://localhost:3000
20//!
21//! testcases:
22//!   - target: /
23//!   - target: /health
24//!   - target: /healthz
25//! ```
26//!
27//! ### Run API for testing
28//! Optional: if there is no API for testing, `relentless-http-dev-server` is provided.
29//! ```sh
30//! cargo install --git https://github.com/hayas1/relentless relentless-http-dev-server
31//! relentless-http-dev-server
32//! ```
33//!
34//! ## Run CLI
35//! ```sh
36//! relentless-http -f compare.yaml
37//! ```
38//! ```plaintext
39//! πŸš€ basic comparison test πŸš€
40//!   actual🌐 http://localhost:3000/
41//!   expect🌐 http://localhost:3000/
42//!   βœ… /
43//!   βœ… /health
44//!   βœ… /healthz
45//!
46//! πŸ’₯ summery of all requests in configs πŸ’₯
47//!   pass-rt: 3/3=100.00%    rps: 6req/22.37ms=268.23req/s
48//!   latency: min=2.774ms mean=8.194ms p50=5.219ms p90=22.127ms p99=22.127ms max=22.127ms
49//! ```
50//! In this case the `actual` and `expect` are the same server, so the request gets the same response and the test passes. βœ…
51//! - Each request is done **concurrently** by default.
52//!
53//! ### More details
54//! | | HTTP | GRPC |
55//! | --- | --- | --- |
56//! | Docs | [relentless-http](https://hayas1.github.io/relentless/relentless_http/) |[relentless-grpc](https://hayas1.github.io/relentless/relentless_grpc/) |
57//!
58//! # Documents
59//! <https://hayas1.github.io/relentless/relentless>
60//!
61//! # Testing
62//! ## Benchmarks
63//! TODO
64//!
65//! ## Coverage
66//! <https://hayas1.github.io/relentless/relentless/tarpaulin-report.html>
67//!
68
69pub mod assault;
70pub mod error;
71pub mod interface;
72
73pub use {error::RelentlessError as Error, error::RelentlessResult as Result};