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

promql: Limit extrapolation of delta/rate/increase #1295

Merged
merged 1 commit into from
Jan 8, 2016
Merged

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented Jan 8, 2016

Here the promised PR. I'm planning to write a blog post about the whole rationale behind the extrapolation… Will be fun.

The new implementation detects the start and end of a series by
looking at the average sample interval within the range. If the first
(last) sample in the range is more than 1.1*interval distant from the
beginning (end) of the range, it is considered the first (last) sample
of the series as a whole, and extrapolation is limited to half the
interval (rather than all the way to the beginning (end) of the
range). In addition, if the extrapolated starting point of a counter
(where it is zero) is within the range, it is used as the starting
point of the series.

Fixes #581

@brian-brazil

@brian-brazil
Copy link
Contributor

👍

// will exist given the spacing between samples we've seen thus far,
// with an allowance for noise.
extrapolationThreshold := averageDurationBetweenSamples * 1.1
extrapolateToInterval := sampledInterval
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to move these lines+comment below the next if block? I found it hard to follow to read about extrapolation, then negative counter capping, then back to extrapolation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure...

@beorn7
Copy link
Member Author

beorn7 commented Jan 8, 2016

Merging. \o/

The new implementation detects the start and end of a series by
looking at the average sample interval within the range. If the first
(last) sample in the range is more than 1.1*interval distant from the
beginning (end) of the range, it is considered the first (last) sample
of the series as a whole, and extrapolation is limited to half the
interval (rather than all the way to the beginning (end) of the
range). In addition, if the extrapolated starting point of a counter
(where it is zero) is within the range, it is used as the starting
point of the series.

Fixes #581
beorn7 added a commit that referenced this pull request Jan 8, 2016
promql: Limit extrapolation of delta/rate/increase
@beorn7 beorn7 merged commit c0474d5 into master Jan 8, 2016
@beorn7 beorn7 deleted the beorn7/rate branch January 8, 2016 14:34
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.

None yet

3 participants