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

stats reset after hatch completes #91

Closed
bretrouse opened this issue Aug 20, 2013 · 4 comments
Closed

stats reset after hatch completes #91

bretrouse opened this issue Aug 20, 2013 · 4 comments

Comments

@bretrouse
Copy link

Why is LocustRunner resetting stats when hatching is complete? What if you want to capture stats at the end of a hatch? I don't understand.

    # register listener that resets stats when hatching is complete
    def on_hatch_complete(count):
        self.state = STATE_RUNNING
        logger.info("Resetting stats\n")
        self.stats.reset_all()
    events.hatch_complete += on_hatch_complete
@cgbystrom
Copy link
Member

To get to the running state as fast as possible, you need to ramp up your Locusts (users) quickly. This often results in an unnatural behaviour that usually put a lot of stress on your servers. The stress can result in possibly higher response times and error rates. To prevent this, Locust reset the stats to prevent those ramp up stats coloring the running stats.

@bretrouse
Copy link
Author

Ah, got it. Thanks!

@spearsem
Copy link

spearsem commented Nov 9, 2017

@cgbystrom Can this be re-opened? The explanation given in #91 (comment) only applies to one type of use case, but there are others.

For example, consider a load test in which you choose a fractional hatch-rate, like adding 1 new user every 30 seconds, or every minute. You might be load testing on a small scale to establish graphs that show you how your service latency saturates with a single server as you steadily increase the number of users.

In a case like that, you don't want to ramp up to the max users quickly, rather slowly. And the data collected about how the service slowly saturates is the important data. The data at the far tail where you are saturated with users is not that relevant on its own.

@heyman
Copy link
Member

heyman commented Nov 10, 2017

@spearsem Locust has had a flag for not resetting the stats for a long time, and since #674 has been merged, it’s now the default behaviour. So you should be good :).

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

4 participants