From 69c4841a0580208ef0c39c6b5f4fec336ccedd5e Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Mon, 24 Mar 2025 17:02:06 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Update=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- config/cli.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a53ba1c..7833592 100644 --- a/README.md +++ b/README.md @@ -57,21 +57,21 @@ Dodo supports CLI arguments, configuration files (JSON/YAML), or a combination o ### 1. CLI Usage -Send 1000 GET requests to https://example.com with 10 parallel dodos (threads) and a timeout of 2 seconds: +Send 1000 GET requests to https://example.com with 10 parallel dodos (threads), each with a timeout of 2 seconds, within a maximum duration of 1 minute: ```sh -dodo -u https://example.com -m GET -d 10 -r 1000 -t 2s +dodo -u https://example.com -m GET -d 10 -r 1000 -o 1m -t 2s ``` With Docker: ```sh -docker run --rm -i aykhans/dodo -u https://example.com -m GET -d 10 -r 1000 -t 2s +docker run --rm -i aykhans/dodo -u https://example.com -m GET -d 10 -r 1000 -o 1m -t 2s ``` ### 2. Config File Usage -Send 1000 GET requests to https://example.com with 10 parallel dodos (threads) and a timeout of 800 milliseconds: +Send 1000 GET requests to https://example.com with 10 parallel dodos (threads), each with a timeout of 800 milliseconds, within a maximum duration of 250 seconds: #### 2.1 JSON Example @@ -83,7 +83,7 @@ Send 1000 GET requests to https://example.com with 10 parallel dodos (threads) a "timeout": "800ms", "dodos": 10, "requests": 1000, - "duration": "10s", + "duration": "250s", "params": [ // A random value will be selected from the list for first "key1" param on each request @@ -233,13 +233,13 @@ docker run --rm -i aykhans/dodo -f https://example.com/config.yaml CLI arguments override config file values: ```sh -dodo -f /path/to/config.yaml -u https://example.com -m GET -d 10 -r 1000 -t 5s +dodo -f /path/to/config.yaml -u https://example.com -m GET -d 10 -r 1000 -o 1m -t 5s ``` With Docker: ```sh -docker run --rm -i -v /path/to/config.json:/config.json aykhans/dodo -f /config.json -u https://example.com -m GET -d 10 -r 1000 -t 5s +docker run --rm -i -v /path/to/config.json:/config.json aykhans/dodo -f /config.json -u https://example.com -m GET -d 10 -r 1000 -o 1m -t 5s ``` ## Config Parameters Reference diff --git a/config/cli.go b/config/cli.go index a09d050..48ae09c 100644 --- a/config/cli.go +++ b/config/cli.go @@ -40,7 +40,7 @@ Flags: -f, -config-file string Path to the local config file or http(s) URL of the config file -d, -dodos uint Number of dodos(threads) (default %d) -r, -requests uint Number of total requests - -o, -duration Time Maximum duration for the test (e.g. 30s, 1m, 5h) + -o, -duration Time Maximum duration for the test (e.g. 30s, 1m, 5h) -t, -timeout Time Timeout for each request (e.g. 400ms, 15s, 1m10s) (default %v) -u, -url string URL for stress testing -m, -method string HTTP Method for the request (default %s)