From 78b0de21c7e5e094192905454a1154f72a8ff2ed Mon Sep 17 00:00:00 2001 From: Cameron Bytheway Date: Fri, 25 Feb 2022 10:31:58 -0700 Subject: [PATCH] netbench: add scenario executable (#1198) --- netbench/netbench-scenarios/Cargo.toml | 11 + netbench/netbench-scenarios/README.md | 169 ++++++++++++++ netbench/netbench-scenarios/src/config.rs | 211 ++++++++++++++++++ netbench/netbench-scenarios/src/lib.rs | 129 +++++++++++ netbench/netbench-scenarios/src/main.rs | 4 + netbench/netbench-scenarios/src/prelude.rs | 46 ++++ .../src/request_response.rs | 97 ++++++++ netbench/netbench/Cargo.toml | 2 + netbench/netbench/src/scenario.rs | 5 + netbench/netbench/src/units/byte.rs | 105 ++++++++- netbench/netbench/src/units/rate.rs | 49 +++- ...bench__units__byte__tests__parse_test.snap | 98 ++++++++ ...bench__units__rate__tests__parse_test.snap | 48 ++++ 13 files changed, 972 insertions(+), 2 deletions(-) create mode 100644 netbench/netbench-scenarios/Cargo.toml create mode 100644 netbench/netbench-scenarios/README.md create mode 100644 netbench/netbench-scenarios/src/config.rs create mode 100644 netbench/netbench-scenarios/src/lib.rs create mode 100644 netbench/netbench-scenarios/src/main.rs create mode 100644 netbench/netbench-scenarios/src/prelude.rs create mode 100644 netbench/netbench-scenarios/src/request_response.rs create mode 100644 netbench/netbench/src/units/snapshots/netbench__units__byte__tests__parse_test.snap create mode 100644 netbench/netbench/src/units/snapshots/netbench__units__rate__tests__parse_test.snap diff --git a/netbench/netbench-scenarios/Cargo.toml b/netbench/netbench-scenarios/Cargo.toml new file mode 100644 index 0000000000..c54e8f831e --- /dev/null +++ b/netbench/netbench-scenarios/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "netbench-scenarios" +version = "0.1.0" +authors = ["AWS s2n"] +edition = "2018" +license = "Apache-2.0" + +[dependencies] +clap = { version = "2", features = ["color", "suggestions"] } +humantime = "2" +netbench = { path = "../netbench" } diff --git a/netbench/netbench-scenarios/README.md b/netbench/netbench-scenarios/README.md new file mode 100644 index 0000000000..0e921d2b48 --- /dev/null +++ b/netbench/netbench-scenarios/README.md @@ -0,0 +1,169 @@ +# netbench-scenarios + +### Executable + +The executable includes a single default scenario: [`request_response`](https://github.com/aws/s2n-quic/blob/main/netbench/netbench-scenarios/src/request_response.rs). This sends `N` number of bytes to the server, which responds with `M` number of bytes. Several options are available for configuration: + +```shell +$ cargo run --bin netbench-scenarios -- --help + +netbench scenarios + +USAGE: + netbench-scenarios [FLAGS] [OPTIONS] [OUT_DIR] + +FLAGS: + -h, --help + Prints help information + + --request_response.parallel + Specifies if the requests should be performed in parallel + + -V, --version + Prints version information + + +OPTIONS: + --request_response.client_receive_rate + The rate at which the client receives data [default: NONE] + + --request_response.client_send_rate + The rate at which the client sends data [default: NONE] + + --request_response.count + The number of requests to make [default: 1] + + --request_response.request_size + The size of the client's request to the server [default: 1KB] + + --request_response.response_delay