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

Implement xrate/xincrease/xdelta functions, as per #3746 #3760

Closed
wants to merge 1 commit into from

Conversation

free
Copy link
Contributor

@free free commented Jan 30, 2018

Took a while to figure out that I also needed to tweak (*Engine).populateIterators() in order to get the extra point(s) before the range start, but it's finally done. And, if I might say so, it's relatively clean (minus the range adjustment at the top of exactRate().

I ended up making one slight change from my original proposal, which is not to adjust the increase by range / sampledInterval, as it would only add noise. If the range is not an "exact" multiple of the sampling interval, I believe it's OK to get a sawtooth pattern for smoothly increasing counters for the price of an exact value (which is quite useful for not-so-smoothly increasing counters). Rates (xrate and xdelta) are not affected by this, as they are always divided by the actual sampled interval, so they will be perfectly smooth for a perfectly smooth counter.

@brian-brazil
Copy link
Contributor

As explained in #3746 (comment) I'm afraid I cannot accept this PR as-is. If you have a proposal that fits in with the rest of PromQL I'd be happy to consider it.

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

2 participants