-
Notifications
You must be signed in to change notification settings - Fork 454
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
[query] Fix Graphite moving functions to include series not in the query but matched by expanded range #3149
[query] Fix Graphite moving functions to include series not in the query but matched by expanded range #3149
Conversation
…ed data with original query fetched time window
// SafeAverage returns the average of the input slice the number of NaNs in the input. | ||
func SafeAverage(input []float64) (float64, int) { | ||
sum, nans := SafeSum(input) | ||
count := len(input) - nans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can they all be NaNs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is actually safe:
https://play.golang.org/p/MhMnzAReOd1
…original-series-mismatch
Codecov Report
@@ Coverage Diff @@
## master #3149 +/- ##
=======================================
Coverage 72.4% 72.4%
=======================================
Files 1099 1099
Lines 102294 102294
=======================================
Hits 74064 74064
Misses 23123 23123
Partials 5107 5107
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
…original-series-mismatch
What this PR does / why we need it:
Previously the moving functions only included datapoints for series that had data in the original time window (plus the shifted values from the moving function window) but was missing datapoints for series that did not have any data in the new time window (but had shifted values from the moving function window).
Decided to also take opportunity to port
movingAverage
to the new moving helper but keptexponentialMovingAverage
where it is since it has significantly different semantics on the windowing and setup for each series.Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: