locust icon indicating copy to clipboard operation
locust copied to clipboard

separate charts for requests per second and average response time

Open nitinyadav745 opened this issue 9 years ago • 3 comments

Description of issue / feature request

Locust to plot graphs based on request URLs

Expected behavior

It would be a great feature if separate charts(at least for average response time ) can be plotted for each request screen shot 2017-11-16 at 1 05 20 pm

Actual behavior

As of now, charts show average response time and requests per second as combined graph for all requests screen shot 2017-11-16 at 1 05 42 pm

nitinyadav745 avatar Nov 16 '17 07:11 nitinyadav745

Currently Locust only provide a few basic graphs, and they are ephemeral (if you reload the page, you'll loose the graph data). There are a ton of stuff that could be done around graphing. However, my current view on this is that if you want to have more advanced or fine grained graphing, it's better to integrate Locust with Grafana (https://grafana.com/) or some other external tool that specialises in this. One can do this by listening to the request_success and request_failure events (https://docs.locust.io/en/latest/api.html#locust.events.request_success).

heyman avatar Nov 16 '17 14:11 heyman

I tried to collect stats from locust master, and render graph with matplotlib.

Hope this will help.

curl -s --data "locust_count=200&hatch_rate=200" "http://localhost:8089/swarm"
echo "Test Begins"
for ((i=1; i<= 300; i++));
do
  curl -s "http://localhost:8089/stats/requests" >> locust-stats.json;
  echo "" >> locust-stats.json;
  sleep 2;
done

curl -s "http://localhost:8089/stop"

myzhan avatar Dec 26 '17 10:12 myzhan

Locust web UI graphing is still very basic, but there are workarounds, for example using https://github.com/SvenskaSpel/locust-plugins and timescale+grafana.

Closing this.

cyberw avatar Oct 18 '19 16:10 cyberw