Skip to content

Commit

Permalink
Add nop methods for Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
mway committed Mar 16, 2021
1 parent fa7c9b1 commit 3911245
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions prometheus/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ func (r *reporter) AllocateCounter(name string, tags map[string]string) tally.Ca
return &cachedMetric{counter: counterVec.With(tags)}
}

// DeallocateCounter implements tally.CachedStatsReporter.
// This is currently a nop method.
func (r *reporter) DeallocateCounter(tally.CachedCount) {}

func (r *reporter) RegisterGauge(
name string,
tagKeys []string,
Expand Down Expand Up @@ -418,6 +422,10 @@ func (r *reporter) AllocateGauge(name string, tags map[string]string) tally.Cach
return &cachedMetric{gauge: gaugeVec.With(tags)}
}

// DeallocateGauge implements tally.CachedStatsReporter.
// This is currently a nop method.
func (r *reporter) DeallocateGauge(tally.CachedGauge) {}

func (r *reporter) RegisterTimer(
name string,
tagKeys []string,
Expand Down Expand Up @@ -557,6 +565,10 @@ func (r *reporter) AllocateTimer(name string, tags map[string]string) tally.Cach
return timer
}

// DeallocateTimer implements tally.CachedStatsReporter.
// This is currently a nop method.
func (r *reporter) DeallocateTimer(tally.CachedTimer) {}

func (r *reporter) AllocateHistogram(
name string,
tags map[string]string,
Expand All @@ -571,6 +583,10 @@ func (r *reporter) AllocateHistogram(
return &cachedMetric{histogram: histogramVec.With(tags)}
}

// DeallocateHistogram implements tally.CachedStatsReporter.
// This is currently a nop method.
func (r *reporter) DeallocateHistogram(tally.CachedHistogram) {}

func (r *reporter) Capabilities() tally.Capabilities {
return r
}
Expand Down

0 comments on commit 3911245

Please sign in to comment.