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

Add warmup counter to EWMA rate #9514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slimjim777
Copy link

@slimjim777 slimjim777 commented Oct 3, 2024

What this PR does

Adds a warm-up period to the EWMA rate so that the rate for the first N samples is returned as 0. The approach mirrors the approach in VividCortex, although there the recommendation is to initialize the moving rate as the mean of the first 60 samples.

Which issue(s) this PR fixes or relates to

Fixes #5443

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2024

CLA assistant check
All committers have signed the CLA.

@slimjim777
Copy link
Author

@jhalterman I took a shot at #5443 and the implementation is in between the VividCortex approach (with a counter) and the current approach with using the sliding window time. This returns 0 during the first 9 ticks, whereas the sliding window time does that for the first 60s.

I amended the existing test for math.EWMARate to expect 0 for the first 9 samples, but I suspect that there other tests that will fail as a result of this change.

@slimjim777
Copy link
Author

Amended the warm-up sample count to be 60 so it's aligned with the sliding window time of 60s.

@slimjim777 slimjim777 marked this pull request as ready for review October 12, 2024 19:13
@slimjim777 slimjim777 requested a review from a team as a code owner October 12, 2024 19:13
@aknuds1 aknuds1 added enhancement New feature or request component/ingester labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ingester enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add warmup to EwmaRate
3 participants