diff options
Diffstat (limited to 'metrics/exp')
-rw-r--r-- | metrics/exp/exp.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/metrics/exp/exp.go b/metrics/exp/exp.go index 625ffd4e8..325a193c7 100644 --- a/metrics/exp/exp.go +++ b/metrics/exp/exp.go @@ -147,21 +147,21 @@ func (exp *exp) publishResettingTimer(name string, metric metrics.ResettingTimer func (exp *exp) syncToExpvar() { exp.registry.Each(func(name string, i interface{}) { - switch i.(type) { + switch i := i.(type) { case metrics.Counter: - exp.publishCounter(name, i.(metrics.Counter)) + exp.publishCounter(name, i) case metrics.Gauge: - exp.publishGauge(name, i.(metrics.Gauge)) + exp.publishGauge(name, i) case metrics.GaugeFloat64: - exp.publishGaugeFloat64(name, i.(metrics.GaugeFloat64)) + exp.publishGaugeFloat64(name, i) case metrics.Histogram: - exp.publishHistogram(name, i.(metrics.Histogram)) + exp.publishHistogram(name, i) case metrics.Meter: - exp.publishMeter(name, i.(metrics.Meter)) + exp.publishMeter(name, i) case metrics.Timer: - exp.publishTimer(name, i.(metrics.Timer)) + exp.publishTimer(name, i) case metrics.ResettingTimer: - exp.publishResettingTimer(name, i.(metrics.ResettingTimer)) + exp.publishResettingTimer(name, i) default: panic(fmt.Sprintf("unsupported type for '%s': %T", name, i)) } |