[Accurate counter PoC_v2] Aggregate counter downsampling using first value and reset docs.#142280
Closed
gmarouli wants to merge 24 commits intoelastic:mainfrom
Closed
[Accurate counter PoC_v2] Aggregate counter downsampling using first value and reset docs.#142280gmarouli wants to merge 24 commits intoelastic:mainfrom
gmarouli wants to merge 24 commits intoelastic:mainfrom
Conversation
Contributor
Author
|
Buildkite benchmark this with tsdb please |
Contributor
Author
|
Buildkite benchmark this with tsdb please |
Contributor
Author
|
Aggregate Last value |
Contributor
Author
|
Buildkite benchmark this with tsdb please |
Collaborator
💚 Build Succeeded
This build ran two tsdb benchmarks to evaluate performance impact of this PR. History
|
Contributor
Author
|
Aggregate Last value |
Contributor
Author
|
PoC ended, #143381 is the result. |
gmarouli
added a commit
that referenced
this pull request
Mar 13, 2026
In this PR we aim to improve the accuracy of the aggregate counter by the following changes: - The downsampled document will record the first and not the last value of the counter. This should improve accuracy because the first value is closer to the start of the bucket than the last value. - If we detect a reset, we track extra documents, the last value before the reset and, optionally, the value after the reset. These documents will preserve the original timestamps. Our hypothesis is that with these two changes, we can have a more accurate counter estimation without a big performance regression (vefiried in #142280), assuming that reset events are rare and usually affect all counters at the same moment. Closes #136178
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is an alternative approach to #140360.
In this approach we aim to improve the accuracy of the aggregate counter by the following changes:
Our hypothesis is that with these two changes, we can have a more accurate counter estimation without a big performance regression, assuming that reset events are rare and usually affect all counters at the same moment.
This PR is built on top of refactoring #140357 because it makes it a much easier change.