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 a reservoir for timers #171

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

maciuszek
Copy link
Contributor

Add a configurable reservoir implementation for timers. This should allow controlled stat load specifically for timers.

@maciuszek maciuszek force-pushed the mattkuzminski/add-timer-reservoir branch from 98706b1 to 72bc838 Compare January 8, 2025 18:27
stats_test.go Outdated
counter = sink.record
if !strings.Contains(counter, expected) {
t.Error("wanted counter value of test.___f=i:1|c, got", counter)
expected = "test.__host=i:1|c"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this test change is out of scope of this work but it was previously volatile with the order of reserved_tag vs test.__host not being deterministic

@maciuszek maciuszek marked this pull request as draft January 8, 2025 18:28
@maciuszek maciuszek changed the title prototype a reservoir for timers add a reservoir for timers Jan 8, 2025
@@ -6,6 +6,7 @@ type Sink interface {
FlushCounter(name string, value uint64)
FlushGauge(name string, value uint64)
FlushTimer(name string, value float64)
FlushAggregatedTimer(name string, value, sampleRate float64)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of this we'll need a new major release.

The library usage should be backwards compatible, and additionally there is a feature flag to control the new behaviour, however if anything is implementing this interface it'll break.

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.

2 participants