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

optional ramping feature; sorting stats by column #11

Merged
merged 41 commits into from
Nov 7, 2011

Conversation

HeyHugo
Copy link
Member

@HeyHugo HeyHugo commented Oct 20, 2011

Added an optional ramping feature; use command line option --ramp to make ramping available in the web UI
When --ramp is used rampstats.py will gather some additional data for calculation of the current percentile. running --ramp will add additional cpu overhead on the master locust ((an append and a pop on a deque) O(n) where n is the number of slaves)
when --ramp is not run locust should not be affected by this feature

Added sorting by column on the stats headers in the UI; works on both Statistics and Failures -panes

…percentile in stats.py to be used in the start_ramp function in core.py.
…nted start_ramp code

start_ramp is now woking; it's ramping up exceeding a boundery then gradually getting closer, splitting the max distance in half til "hatch_stride" is lower than "precision"
… tab and Failures tab.

The sorting is not rendered until the next updateStats call though (so once every 2 seconds)
"current_percentile" calculates the response time percentile for the requests in a time window.
It is implemented to work in both distributed and local mode.
autotune.py listens to the events on_slave_report, on_report_to_master and on_request_success and handles a deque of the latest response times TIME_WINDOW seconds back in time.
Added variable reset to start_ramping, if reset is set to true all currently spawned clients will be killed
Added variable start_count; start_count is the number of clients that will be spawned before starting the ramping
…on current_percentile since all this functionality now is in autotune.py
removed <a> tag element on the labels and use the <th> instead
fixed a check of the key "current_reponses" in data for the event on_slave_report so that the list of responsetimes is only appended if the key exists
…ponse times for being used in the start_ramping function
…is because of that the kill_locusts name fits better if the function adding clients is named spawn_locusts
Fixed so that the ramp down will never kill less than "precision" amount of clients
… used; this to make the UI for ramp optional as well

Changed "/ramp" route to fit with the ramp form in the web UI
…his I made the start_ramping spawn in a separate greenlet

added "calibration_time" to the ramp form in the interface
…fter a test has already been run (the ramp_text should only be shown on the index page when no test has yet been run)
…ad of hatch_rate) in start_ramping when spawning the initial number of clients


if options.ramp:
import autotune
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might have forgot to commit autotune.py?

if len(master_response_times) > slaves * response_times_per_slave_count:
master_response_times.popleft()

events.request_success += on_request_success
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting up of the event listeners should probably be conditioned by an if block, so that the ramping stats overhead isn't activated by mistake if someone imports rampstats.

The best thing would probably be to set up the listeners in either main.py or core.py (but still keep the listener functions in rampstats.py of course).

@heyman
Copy link
Member

heyman commented Oct 21, 2011

Hi! I haven't had time to run the code yet, but I've went through it. Overall it's looking great. I've added line notes on a few small things that I think could be improved.

Great job!

@HeyHugo
Copy link
Member Author

HeyHugo commented Oct 21, 2011

Hi! Now I think I've fixed the issues pointed out

Changed so that RequestStats property fail_ratio is used in web.py instead of caluculating the fail ratio there
…w only done once and the result put in a variable in rampstats.py
…ptable fail ratio

Before there was a problem if the acceptable fail ratio was 0
heyman added a commit that referenced this pull request Nov 7, 2011
Optional feature for letting locust ramp up and choose number of users automatically. Sorting of stats in web UI.
@heyman heyman merged commit 36a29c6 into locustio:master Nov 7, 2011
cpennington added a commit to cpennington/locust that referenced this pull request Aug 26, 2015
tyge68 added a commit to tyge68/locust that referenced this pull request Sep 15, 2021
# This is the 1st commit message:

locustio#1884 User distribution should happen when new workers comes in

# This is the commit message locustio#2:

locustio#1884 reformatting

# This is the commit message locustio#3:

locustio#1884 Make rebalance interval configurable

# This is the commit message locustio#4:

locustio#1884 Adding integration test for rebalanced

# This is the commit message locustio#5:

locustio#1884 revert change

# This is the commit message locustio#6:

locustio#1886 Simplify solution

# This is the commit message locustio#7:

locustio#1886 adding missing dependency

# This is the commit message locustio#8:

locustio#1884 Adding back enable rebalancing option

# This is the commit message locustio#9:

locustio#1884 adding extra comment the test

# This is the commit message locustio#10:

locustio#1884 renaming as suggested

# This is the commit message locustio#11:

locustio#1884 update help description

# This is the commit message locustio#12:

locustio#1884 handling of missing workers to rebalance
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.

2 participants