You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent that, we would need to make sure we create a sample only if a histogram is not present. At present, I am doing this with a mutex protected dict, but this is annoying.
Can we turn this function into accepting a Sample generator callback instead?
type NewSampleFunc func() Sample
// GetOrRegisterHistogramWithSampleFunc(name string,
// r Registry,
// s NewSampleFunc) Histogram
metrics.GetOrRegisterHistogramWithSampleFunc(metricName,
metricsRegistry,
func(){return NewUniformSample(size)}).Inc(amount)
The text was updated successfully, but these errors were encountered:
I usually use counters, gauges and timers in code somewhat like this:
But doing the same thing with Histograms are a problem. This is the call signature.
If I want to use an UniformSample, am I supposed to use it like this?
But that would create a new sample on every call.
To prevent that, we would need to make sure we create a sample only if a histogram is not present. At present, I am doing this with a mutex protected dict, but this is annoying.
Can we turn this function into accepting a Sample generator callback instead?
The text was updated successfully, but these errors were encountered: