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 sampled timer #109

Open
andreynkravtsov opened this issue Sep 11, 2019 · 0 comments
Open

Implement sampled timer #109

andreynkravtsov opened this issue Sep 11, 2019 · 0 comments

Comments

@andreynkravtsov
Copy link

Currently the timer implementation does not provide out-of-the-box sampling of the values and floods the aggregator if used in high QPS. There is an implementation of the sampled timer done at https://github.com/m3db/m3/blob/master/src/x/instrument/methods.go#L45

Perhaps we could pull that implementation into tally.

In addition, I've noticed that the implementation at the above URL lacks support for Stop() (only uses Record) due to null value of the recorder in the nullStopWatchStart, so a small tweak would need to be done if the solution is taken as-is.

nullStopWatchStart = tally.NewStopwatch(time.Time{}, nullRecorder{})
type nullRecorder struct{}
func (n nullRecorder) RecordStopwatch(stopwatchStart time.Time) {}

Else current Stop() of the Stopwatch fails due to null pointer use

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

No branches or pull requests

1 participant