myzhan / boomer

A better load generator for locust, written in golang.
MIT License
1.19k stars 244 forks source link

Prometheus and Grafana #34

Closed ghost closed 6 years ago

ghost commented 6 years ago

I was thinking of writing some documentation on Prometheus, exporters and Grafana and submit a PR. WDYT? The idea I suppose is to bypass the Locust UI. I think the node and stats exporter could be exampled. As you mention the swarm rate is go routines and we have the max rate built in via your flag.

myzhan commented 6 years ago

Any PR is welcome. In my daily work, I did similar things with Jenkins and Docker, and it's doable.

ghost commented 6 years ago

I was thinking of using the Locust --no-web switch and awk to parse console output and netcat to send the metric to the statsd_exporter. Pretty low-fi , I know - but I should be able to graph metrics in Grafana.

myzhan commented 6 years ago

Another option with the WebUI.

  1. Start 100 users with a hatch rate of 10.
curl --data "locust_count=100&hatch_rate=10" "http://locust:8089/swarm"
  1. Collect json stats every 2 seconds, like the ajax request.
for ((i=1; i<= 300; i++));
do
  curl -s "http://localhost:8089/stats/requests" >> locust-stats.json;
  echo "" >> locust-stats.json;
  sleep 2;
done
  1. Stop the test.
curl -s "http://localhost:8089/stop"

You will get locust-stats.json, easier to parse.

ghost commented 6 years ago

Thanks for the suggestion but I am thinking the boomer rps flags and the locust user/ swarm rate could be confusing for the load tester, and I am leaning towards no interaction with the Locust UI. Although I could be heading in the wrong direction.

ghost commented 6 years ago

Yeah, Looks like a real hassle parsing stout or using tee. Getting broken connection and peer resets when using the Locust UI.

ghost commented 6 years ago

@myzhan Your technique works. Thanks.