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

Option to prevent stats from being reset when all locusts are hatched #205

Closed
byronh opened this issue Nov 13, 2014 · 10 comments
Closed

Option to prevent stats from being reset when all locusts are hatched #205

byronh opened this issue Nov 13, 2014 · 10 comments
Labels

Comments

@byronh
Copy link

byronh commented Nov 13, 2014

How does one prevent the stats from being automatically reset once all locusts are hatched? I understand that this is the intended behavior of Locust, but for my particular use case I need the stats not to be reset.

What is the recommended workaround for this?

@Jahaja
Copy link
Member

Jahaja commented Dec 6, 2014

You could do this by overriding this block of code:
https://github.com/locustio/locust/blob/master/locust/runners.py#L41-L46

@Jahaja Jahaja closed this as completed Dec 6, 2014
@heyman
Copy link
Member

heyman commented Apr 7, 2015

I'm re-opening this issue because it keeps popping up, so it might be good to provide an option for turning off the resetting of the stats.

Until a solution has been implemented, here's a workaround that I posted in #236, that monkey patches Locust and disables stats resetting (will also make the "Reset stats" button in the web UI not work):

from locust.stats import RequestStats
def noop(*arg, **kwargs):
    print "Stats reset prevented by monkey patch!"
RequestStats.reset_all = noop

@heyman heyman reopened this Apr 7, 2015
@heyman heyman changed the title How to prevent stats from being reset when all locusts are hatched? Option to prevent stats from being reset when all locusts are hatched Apr 7, 2015
@kawing-chiu
Copy link

Run into the same issue today. Hope it will be fixed soon. :)

@pior
Copy link

pior commented Aug 26, 2015

I'm also in favor of this setting.

The requests in on_start() are part of what I want to measure

@alexandrul
Copy link

+1

@jjstellr
Copy link

+1

1 similar comment
@JordyvanDortmont
Copy link

+1

@noisyboiler
Copy link

+1

@alexandrul
Copy link

This was implemented on master a few days ago, see the changelog and the previous commits: c61d3bb

@noisyboiler
Copy link

thanks @alexandrul

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

Successfully merging a pull request may close this issue.