go-metrics icon indicating copy to clipboard operation
go-metrics copied to clipboard

Allow to set samples rescale threshold

Open kaero opened this issue 11 years ago • 4 comments

Global function to set and get global rescale threshold for exponentially decaying samples, which construction is hidden by default metrics constructors.

kaero avatar Sep 04 '14 17:09 kaero

@rcrowley PR doesn't includes tests, because I want to discuss the solution before finish the PR.

I think, the most robust solution will be change of the EDS structure and constructor to allow custom rescale threshold as the field and argument. But it will break the backward compatibility and grows up the complexity of the user code, which requires custom rescale threshold, because it avoids the ability to use Registry.GetOrRegisterTimer, for example. So my changes provides an easy way to set custom rescale threshold for a whole application, which covers my application requirements :)

kaero avatar Sep 06 '14 13:09 kaero

First of all, I'm sorry for the delay. Second of all, I'm wondering what you think about just exporting RescaleThreshold as a number. If you set it in init or main before launching any goroutines it's perfectly safe and we'd avoid the read-write lock every time it rescales.

Plus, that wouldn't need tests. :)

rcrowley avatar Oct 04 '14 23:10 rcrowley

@kaero thoughts on @rcrowley's last comment? Thanks!

mihasya avatar Jul 04 '15 19:07 mihasya

Any progress here?

narqo avatar Nov 24 '15 21:11 narqo