-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Inconsistent stats resetting #299
Comments
I run into similar issue as well. The # requests counter reset. In my case, I haven't override on_start() at all. |
Stats resetting is intended behavior. See #91 for motivation. |
You saying: "intended behavior", makes it sound like all what's described here is working as desired. Since you're the original poster I assume that's not what you mean. I agree totally with your original observation that |
Sorry if it was confusing. What I meant is that it works as desired if you don't have any HTTP requests inside I thought about events initially, but after further investigation discarded this idea (it is quite complex and is bad from the conceptual point of view). I implemented much simpler alternative for my current project. If you think a bit about requests
Also I modified the This approach is quite simple and doesn't break existing contract. So if maintainers is going to merge such change, I can provide a pull request. |
People certainly have different use cases. In our system and its tests we're pre-providing users with a configuration file, and our This is aggravated by each locust (potentially) running with different credentials, and the obtained seed data may be different accordingly. So our |
If I have requests inside
on_start()
method of my main task set, stats will be reseted before all requests are completed. As a result I get some of the initialization requests inside report and they clutter the data.Relevant code: hatch().
I'm not closely familiar with gevent/greenlets, but issue seems to be related to greenlets nature. When request is sent from
on_start()
method it switches context back tohatch()
and since all locusts are already hatched it emitshatch_complete
event (but requests fromon_start()
are still running).As a solution I see some kind of synchronization to let runner know, that locust initialization is done. Any ideas how to deal with this?
The text was updated successfully, but these errors were encountered: