Fix memory leak in metrics
Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>
This commit is contained in:
parent
683d5d5a48
commit
b40fa61783
3 changed files with 13 additions and 31 deletions
|
@ -19,9 +19,9 @@ func TestScalableHistogram(t *testing.T) {
|
|||
|
||||
ticker := time.NewTicker(500 * time.Millisecond)
|
||||
<-ticker.C
|
||||
sh.StartAt(time.Now())
|
||||
start := time.Now()
|
||||
<-ticker.C
|
||||
sh.ObserveDuration()
|
||||
sh.ObserveFromStart(start)
|
||||
|
||||
var b bytes.Buffer
|
||||
h.Print(&b)
|
||||
|
@ -99,9 +99,7 @@ func (c *histogramMock) With(labelValues ...string) ScalableHistogram {
|
|||
|
||||
func (c *histogramMock) Start() {}
|
||||
|
||||
func (c *histogramMock) StartAt(t time.Time) {}
|
||||
|
||||
func (c *histogramMock) ObserveDuration() {}
|
||||
func (c *histogramMock) ObserveFromStart(t time.Time) {}
|
||||
|
||||
func (c *histogramMock) Observe(v float64) {
|
||||
c.lastHistogramValue = v
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue