You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use clap derive, fixing behavior of --include flag. (#121)
* Add clap derive macros and attributes to structs
* restore default behavior of stats_file
* Use static Lazy for a Regex
* Use Tmp struct for try config, needed for results_dir
* comments
* fix typo in comment
* another typo
* Direct port of tests from builder to derive version.
Some tests now fail as a result of the new `-i` flag behavior.
* Fix broken tests to use new `-i` behavior.
* Add new test that uses built-in clap checker
* Add new test.
Verifies that the config file can come after an --include flag, and checks that a Ne filter can be properly parsed.
* Remove old code, update use paths.
* New test: checks that old `-i` behavior doesn't work
* Improve consistency between output depicted in book and actual output.
The text wrapping of the option descriptions depends on the size of the terminal window when the program is run. A wrapping length that is relatively short but leaves the descriptions in a fully separate column was chosen for the example in the book.
Copy file name to clipboardexpand all lines: guide/src/cli.md
+42-42
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,18 @@ There are two ways that Pewpew can execute: either a full load test or a try run
4
4
<br/><br/>
5
5
6
6
```
7
-
USAGE:
8
-
pewpew <SUBCOMMAND>
7
+
The HTTP load test tool https://familysearch.github.io/pewpew
9
8
10
-
FLAGS:
11
-
-h, --help Prints help information
12
-
-V, --version Prints version information
9
+
Usage: pewpew <COMMANND>
13
10
14
-
SUBCOMMANDS:
15
-
run Runs a full load test
16
-
try Runs the specified endpoint(s) a single time for testing purposes
11
+
Commands:
12
+
run Runs a full load test
13
+
try Runs the specified endpoint(s) a single time for testing purposes
14
+
help Print this message or the help of the given subcommand(s)
15
+
16
+
Options:
17
+
-h, --help Prints help information
18
+
-V, --version Prints version information
17
19
```
18
20
19
21
As signified in the above help output, there are two subcommands `run` and `try`.
@@ -22,24 +24,22 @@ Here's the output of `pewpew run --help`:
22
24
<br/><br/>
23
25
24
26
```
25
-
USAGE:
26
-
pewpew run <CONFIG>
27
-
28
-
OPTIONS:
29
-
-h, --help Prints help information
30
-
-f, --output-format <FORMAT> Formatting for stats printed to stdout [default: human] [possible values:
31
-
human, json]
32
-
-d, --results-directory <DIRECTORY> Directory to store results and logs
33
-
-t, --start-at <START_AT> Specify the time the test should start at
34
-
-o, --stats-file <STATS_FILE> Specify the filename for the stats file
35
-
-s, --stats-file-format <FORMAT> Format for the stats file [default: json] [possible values: json]
36
-
-w, --watch Watch the config file for changes and update the test accordingly
37
-
38
-
ARGS:
39
-
<CONFIG> Load test config file to use
40
-
41
-
ARGS:
42
-
<CONFIG> Load test config file to use
27
+
Usage: pewpew run [OPTIONS] <CONFIG>
28
+
29
+
Arguments:
30
+
<CONFIG> Load test config file to use
31
+
32
+
Options:
33
+
-f, --output-format <FORMAT> Formatting for stats printed to stdout [default: human]
34
+
[possible values: human, json]
35
+
-d, --results-directory <DIRECTORY> Directory to store results and logs
36
+
-t, --start-at <START_AT> Specify the time the test should start at
37
+
-o, --stats-file <STATS_FILE> Specify the filename for the stats file
38
+
-s, --stats-file-format <FORMAT> Format for the stats file [default: json] [possible values:
39
+
json]
40
+
-w, --watch Watch the config file for changes and update the test
41
+
accordingly
42
+
-h, --help Prints help information
43
43
```
44
44
45
45
The `-f`, `--output-format` parameter allows changing the formatting of the stats which are printed to stdout.
@@ -54,22 +54,22 @@ Here's the output of `pewpew try --help`:
54
54
<br/><br/>
55
55
56
56
```
57
-
USAGE:
58
-
pewpew try [OPTIONS] <CONFIG>
59
-
60
-
OPTIONS:
61
-
-o, --file <FILE> Send results to the specified file instead of stdout
62
-
-f, --format <FORMAT> Specify the format for the try run output [default: human] [possible values:
63
-
human, json]
64
-
-h, --help Prints help information
65
-
-i, --include <INCLUDE>...Filter which endpoints are included in the try run. Filters work based on an
66
-
endpoint's tags. Filters are specified in the format "key=value" where "*" is
67
-
a wildcard. Any endpoint matching the filter is included in the test
68
-
-l, --loggersEnable loggers defined in the config file
69
-
-d, --results-directory <DIRECTORY>Directory to store logs (if enabled with --loggers)
70
-
71
-
ARGS:
72
-
<CONFIG>Load test config file to use
57
+
Usage: pewpew try [OPTIONS] <CONFIG>
58
+
59
+
Arguments:
60
+
<CONFIG> Load test config file to use
61
+
62
+
Options:
63
+
-o, --file <FILE>Send results to the specified file instead of stdout
64
+
-f, --format <FORMAT>Specify the format for the try run output [default: human]
65
+
[possible values: human, json]
66
+
-i, --include <INCLUDE>Filter which endpoints are included in the try run. Filters
67
+
work based on an endpoint's tags. Filters are specified in
68
+
the format "key=value" where "*" is a wildcard. Any
69
+
endpoint matching the filter is included in the test
70
+
-l, --loggers Enable loggers defined in the config file
71
+
-d, --results-directory <DIRECTORY> Directory to store logs (if enabled with --loggers)
72
+
-h, --help Prints help information
73
73
```
74
74
75
75
A try run will run one or more endpoints a single time and print out the raw HTTP requests and responses to stdout. By default all endpoints are included in the try run. This is useful for testing out a [config file](./config.md) before running a full load test. When the `--include` parameter is used, pewpew will automatically include any other endpoints needed to provide data for the explicitly included endpoints.
0 commit comments