Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've done a quite large refactoring of how the request statistics are stored internally.
I've broken out large parts of the RequestStats class into a StatsEntry class. The reason for this is that previously the RequestStats class was actually doing two different things. On the global class level, it was holding the global, aggregated stats, while on the instance level it was tracking statistics for single urls/stats entries. Now RequestStats should be instantiated and holds the global stats, as well as a dict of StatsEntry instances which holds the stats for single stats entries (URLs)
This should also be the first step of removing some global state in Locust, which is nice because we will be able to test things better. We might also facilitate it when we implement the support for different Clients (if we choose to use dependency injection for providing the Clients with the ability to report requests that are made).
I've also implemented some tests for the web UI, which I think will be a great starting point to write more tests and get more test coverage in that area.
In general, I'm quite happy with the result, but since it's a large refactoring, I would love to have a second pair of eyes on the changes :) (ping @Jahaja @cgbystrom)