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 refactoring #74

Merged
merged 4 commits into from
May 20, 2013
Merged

Stats refactoring #74

merged 4 commits into from
May 20, 2013

Conversation

heyman
Copy link
Member

@heyman heyman commented May 16, 2013

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)

heyman added 4 commits May 16, 2013 16:20
Out of RequestStats, factored out a StatsEntry class which represents a single stats entry (URL). Previously the RequestStats class was actually doing two different things: On the global class level, it was holding track of the aggregated stats from all requests, and on the instance level holding the stats for single 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)
…ssingSchema exception (instead of InvalidSchema) when using telnet:127.0.0.1, even though it apparently is working on TravisCI. But telnet://127.0.0.1 should be invalid as well so this change should be OK.
heyman added a commit that referenced this pull request May 20, 2013
@heyman heyman merged commit 9c599de into master May 20, 2013
pancaprima pushed a commit to pancaprima/locust that referenced this pull request Aug 21, 2018
…io#74)

* add object for test suite, test case, and test step

* requested changes

* requested changes

* requested changes eps 2
@mbeacom mbeacom deleted the stats-refactor branch October 18, 2019 20:48
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

Successfully merging this pull request may close these issues.

1 participant