Fix Regression in Full History CSV Percentiles #1873
Merged
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.
The docstring for _stats_history_data_rows says it should be outputting
*current* stats
(emphasis not added by me). In the original commit from December 3rd, 2019, it was properly using theget_current_response_time_percentile
function.On August 18th, 2020, the code was all reformatted and it looks like a regression was accidentally introduced when they switched over to using
get_response_time_percentile
instead.This PR simply fixes that regression, switching back to using
get_current_response_time_percentile
.The bug is easiest to observe if you have a spikey/bursty test shape. During bursts, latency increases. During quieter times, latency goes back down. This is properly reflected in the Locust Web UI's graph tab, but the full history CSV file doesn't show that - instead there's only a slight decline in latency between bursts, because it's showing the 95th percentile since the test began rather than just for the past 10 seconds.
I suspect the bug went just over a year without being noticed because it's unusual to either (1) use a custom load shape for a test and (2) to closely examine the full history CSV file.