Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
debugtalk committed Dec 2, 2021
1 parent dcba1df commit b75ffc1
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## v0.2.1 (2021-11-26)
## v0.2.1 (2021-12-02)

- feat: push load testing metrics to Prometheus Pushgateway
- feat: report events with Google Analytics

## v0.2.0 (2021-11-19)
Expand Down
67 changes: 67 additions & 0 deletions docs/boomer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Load Test

## Run load test

`HttpRunner+` supports running load test without extra work. You can use `hrp boom` command to run YAML/JSON testcases in load testing mode.

By default, hrp will print load testing results in console output, refreshed every 3 seconds.

```
$ hrp boom examples/demo.json --spawn-count 10 --spawn-rate 1
6:09PM INF Set log to pretty console
6:09PM INF Set log level to INFO
6:09PM INF Set log level to WARN
2021/12/02 18:09:48 Spawning 10 clients immediately
Current time: 2021/12/02 18:09:51, Users: 10, Total RPS: 20, Total Fail Ratio: 0.0%
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| TYPE | NAME | # REQUESTS | # FAILS | MEDIAN | AVERAGE | MIN | MAX | CONTENT SIZE | # REQS/SEC | # FAILS/SEC |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| request-GET | get with params | 10 | 0 | 2400 | 2423.00 | 2422 | 2424 | 300 | 10 | 0 |
| request-POST | post json data | 10 | 0 | 310 | 304.50 | 301 | 307 | 420 | 10 | 0 |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
Current time: 2021/12/02 18:09:54, Users: 10, Total RPS: 16, Total Fail Ratio: 0.0%
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| TYPE | NAME | # REQUESTS | # FAILS | MEDIAN | AVERAGE | MIN | MAX | CONTENT SIZE | # REQS/SEC | # FAILS/SEC |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| request-GET | get with params | 18 | 0 | 1200 | 1157.39 | 1083 | 1367 | 300 | 9 | 0 |
| request-POST | post json data | 10 | 0 | 290 | 290.20 | 287 | 293 | 420 | 10 | 0 |
| request-POST | post form data | 20 | 0 | 310 | 300.00 | 287 | 311 | 441 | 10 | 0 |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
Current time: 2021/12/02 18:09:57, Users: 10, Total RPS: 17, Total Fail Ratio: 0.0%
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| TYPE | NAME | # REQUESTS | # FAILS | MEDIAN | AVERAGE | MIN | MAX | CONTENT SIZE | # REQS/SEC | # FAILS/SEC |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
| request-GET | get with params | 12 | 0 | 1100 | 1153.92 | 1081 | 1464 | 300 | 6 | 0 |
| request-POST | post json data | 20 | 0 | 270 | 279.70 | 269 | 337 | 420 | 6 | 0 |
| request-POST | post form data | 20 | 0 | 270 | 272.85 | 269 | 279 | 441 | 10 | 0 |
+--------------+-----------------+------------+---------+--------+---------+------+------+--------------+------------+-------------+
```

If you want to disable console output, you can add a `--disable-console-output` flag.

```
$ hrp boom examples/demo.json --spawn-count 10 --spawn-rate 1 --disable-console-output
```

You can reference this [doc](cmd/hrp_boom.md) for all command arguments.

## Report metrics to Prometheus Pushgateway

Besides printing load testing results in console, you can also push metrics to [Prometheus Pushgateway][pushgateway_github], and then you can configure pretty graphs on [Grafana][Grafana].

```
$ hrp boom examples/demo.json --spawn-count 10 --spawn-rate 1 --prometheus-gateway http://127.0.0.1:9091
```

You can deploy the Pushgateway using the [prom/pushgateway][pushgateway_docker] Docker image at ease.

```
$ docker pull prom/pushgateway
$ docker run -d -p 9091:9091 prom/pushgateway
```

[pushgateway_github]: https://github.com/prometheus/pushgateway
[pushgateway_docker]: https://hub.docker.com/r/prom/pushgateway
[Grafana]: https://grafana.com/
2 changes: 1 addition & 1 deletion docs/cmd/hrp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Copyright 2021 debugtalk
* [hrp har2case](hrp_har2case.md) - Convert HAR to json/yaml testcase files
* [hrp run](hrp_run.md) - run API test

###### Auto generated by spf13/cobra on 26-Nov-2021
###### Auto generated by spf13/cobra on 2-Dec-2021
4 changes: 3 additions & 1 deletion docs/cmd/hrp_boom.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ hrp boom [flags]
```
--cpu-profile string Enable CPU profiling.
--cpu-profile-duration duration CPU profile duration. (default 30s)
--disable-console-output Disable console output.
-h, --help help for boom
--max-rps int Max RPS that boomer can generate, disabled by default.
--mem-profile string Enable memory profiling.
--mem-profile-duration duration Memory profile duration. (default 30s)
--prometheus-gateway string Prometheus Pushgateway url.
--request-increase-rate string Request increase rate, disabled by default. (default "-1")
--run-tasks string Run tasks without connecting to the master, multiply tasks is separated by comma. Usually, it's for debug purpose.
--spawn-count int The number of users to spawn for load testing (default 1)
Expand All @@ -37,4 +39,4 @@ hrp boom [flags]

* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 26-Nov-2021
###### Auto generated by spf13/cobra on 2-Dec-2021
2 changes: 1 addition & 1 deletion docs/cmd/hrp_har2case.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ hrp har2case harPath... [flags]

* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 26-Nov-2021
###### Auto generated by spf13/cobra on 2-Dec-2021
2 changes: 1 addition & 1 deletion docs/cmd/hrp_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ hrp run path... [flags]

* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 26-Nov-2021
###### Auto generated by spf13/cobra on 2-Dec-2021
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ nav:
- hrp_run: cmd/hrp_run.md
- hrp_har2case: cmd/hrp_har2case.md
- hrp_boom: cmd/hrp_boom.md
- Load Test: boomer.md
- Sponsors: sponsors.md
- Release History: CHANGELOG.md

0 comments on commit b75ffc1

Please sign in to comment.