Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get the recorded data #206

Closed
atlurihk opened this issue Nov 19, 2014 · 8 comments
Closed

how to get the recorded data #206

atlurihk opened this issue Nov 19, 2014 · 8 comments

Comments

@atlurihk
Copy link

I want to know how to save the response rate and all the statistics of locust for every 5 seconds. So that i can use it to plot graphs and analyse when effectiveness of my web server.

Is there any plugins already developed??
Also, can u link me with the document that explains every field of locust ( req/sec is the total concurrent users it is supporting at the moment?) and what is distribution 50% 60%... 100%?

@robgil
Copy link

robgil commented Nov 20, 2014

I was also hoping to get all of the raw stats for graphing purposes. We see some high latency on some requests, obviously pushing the max up and average. We're guessing its cache misses on expire, but would like to prove it.

Thanks!

@Jahaja
Copy link
Member

Jahaja commented Dec 6, 2014

There's no plugins or similar for this. But you can create simple script that requests stats from the Locust UI every 5th second. You'd be using the same json endpoint as the UI is using to display the stats.

@Jahaja Jahaja closed this as completed Dec 6, 2014
@Alex-Bogdanov
Copy link

@robgil You could run locust with --no-web and --print-stat options (it produces response time stat nearly each 5 sec to stdout). That should helps.

@Jahaja I think it would be quite tedious to run in parallel both locust/main.py and some custom script requesting locust stat. Maybe it's better to extend existing code. That would be great to output these request stat and response time distribution stat in csv file after all Locust users are dead, not just spitting it to stdout as a plain text in --no-web mode (which is not really much reusable from python code). There is an option for locust logs like --logfile. I can contribute some small extension for generating all the stat to a CSV files by setting some --output-stat option. Do you think it would be useful?

@ghost
Copy link

ghost commented Mar 14, 2017

I think this would useful at the least @Alex-Bogdanov , I am currently automating some tests and realizing I can't easily retrieve the stats. Even the ones from the web IO are useful, but I will end up capturing my own I think.

@aldenpeterson-wf
Copy link
Contributor

@sylink, there is also a --only-summary option for locust which you could use in combination with --no-web and redirect the output to a file.

@ghost
Copy link

ghost commented Mar 14, 2017

I am checking out RequestStats, as well, to see if I can just pull them on exit after a test, though its not clear to me how to call it precisely.

@fruch
Copy link

fruch commented Mar 21, 2017

Those type of things would be super helpful, so we could get information, and create graphs based on the data.

@ghost
Copy link

ghost commented Mar 21, 2017

Yes, it seems like what you really need is a simpler API to grab whatever from it, then its neutral. I did determine a way to do this with the existing global stats stuff.
`
def on_quitting():
text='name,method,min_response,max_response,num_requests,average_response_time\n'
#print(global_stats.entries)
for key,value in global_stats.entries:
entry=global_stats.get(key,value)
text+=return_csv(entry)
f=open('test.log','w')
f.write(text)
f.close()

events.quitting += on_quitting`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants