Add rolling statistics to summary graph #351
Open
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.
Summary:
This commit adds the option to show rolling statistics as additional lines on the summary graph. Currently this can either be a rolling mean or percentile. The other aggregate statistics are preserved separately. This works for both tagged and untagged summary graphs. The feature is disabled by default.
Configuration is done with two new reporter_options like so:
The "mode" is either
"mean"
for mean, or"pX"
, where X is an integer from 0-100, for a percentile. The statistic is computed over a backwards looking window that contains the last N seconds as set byderive_window_secs
.On the javascript side we register new series and dataset with
findOrCreateSeries()
and modify the dataset object to include information on which statistics to compute and which series the new dataset is derived from.Incidentally, I think this addresses #245.
Feedback appreciated! Thanks!
Test Plan:
metrics_live_test.js
: I added new unit tests to cover the derived series cases and updated the old tests to account for the new dataset object.chart_component_tests.exs
: New unit tests similar to the ones for the pruning option.dev.exs
: I put an example usage in dev.exs and tested end-to-end manuallyExample: