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
@@ -783,6 +786,8 @@ It'll read and sort them by timestamp before generating reports.
783
786
vegeta report *.bin
784
787
```
785
788
789
+
Another way to gather results in distributed tests is to use the built-in Prometheus Exporter and configure a Prometheus Server to get test results from all Vegeta instances. See `attack` option "prometheus-addr" for more details and a complete example in the section "Prometheus Support".
790
+
786
791
## Usage: Real-time Analysis
787
792
788
793
If you are a happy user of iTerm, you can integrate vegeta with [jplot](https://github.com/rs/jplot) using [jaggr](https://github.com/rs/jaggr) to plot a vegeta report in real-time in the comfort of your terminal:
Just pass a new number as the argument to change it.
861
866
867
+
## Prometheus Support
868
+
869
+
Vegeta has a built-in Prometheus Exporter that may be enabled during attacks so that you can point any Prometheus instance to Vegeta instances and get some metrics about http requests performance and about the Vegeta process itself.
870
+
871
+
To enable the Prometheus Exporter on the command line, use the "prometheus-addr" flag.
872
+
873
+
A Prometheus HTTP endpoint will be available only during the lifespan of an attack and will be closed right after the attack is finished.
874
+
875
+
The following metrics are exposed:
876
+
877
+
*`request_bytes_in` - bytes count received from targeted servers by "url", "method" and "status"
878
+
*`request_bytes_out` - bytes count sent to targeted server by "url", "method" and "status"
879
+
*`request_seconds` - histogram with request latency and counters by "url", "method" and "status"
880
+
881
+
<imagesrc="prometheus-sample.png"width="500" />
882
+
883
+
Check file [lib/prom/grafana.json](lib/prom/grafana.json) with the source of this sample dashboard in Grafana.
884
+
885
+
### Samples
886
+
887
+
If you want to query P90 quantiles, for example, use "histogram_quantile(0.90, sum(rate(request_seconds_bucket[1m])) by (le, status))"
* Run `curl localhost:8880` to see plain Prometheus Exporter endpoint contents
915
+
916
+
* Open Prometheus server instance with your browser at http://localhost:9090
917
+
918
+
* Go to "Graph" and execute query `rate(request_seconds_sum[1m])` and then select the "Graph" tab to see a graph with latency over time
919
+
920
+
#### More resources
921
+
922
+
* See https://prometheus.io/docs/prometheus/latest/querying/basics/ for query details
923
+
924
+
* Use Grafana for creating stateful dashboards. Get a sample dashboard for Vegeta [here](grafana.json)
925
+
926
+
* For more elaborated scenarios, see https://github.com/flaviostutz/promster so that you can automatically register new Vegeta Prometheus Exporter instances to Prometheus in elastic scenarios.
0 commit comments