From 0b30e065c87d82f746a3c1f899ce95a4524cf3db Mon Sep 17 00:00:00 2001 From: Bernerd Schaefer Date: Fri, 19 Apr 2013 13:22:59 +0200 Subject: [PATCH] Metrics explicitly implement Metric interface --- prometheus/counter.go | 5 ++--- prometheus/gauge.go | 4 +--- prometheus/histogram.go | 4 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/prometheus/counter.go b/prometheus/counter.go index 74b76dd..ba4a776 100644 --- a/prometheus/counter.go +++ b/prometheus/counter.go @@ -14,14 +14,13 @@ import ( // TODO(matt): Refactor to de-duplicate behaviors. type Counter interface { - AsMarshallable() map[string]interface{} + Metric + Decrement(labels map[string]string) float64 DecrementBy(labels map[string]string, value float64) float64 Increment(labels map[string]string) float64 IncrementBy(labels map[string]string, value float64) float64 - ResetAll() Set(labels map[string]string, value float64) float64 - String() string } type counterVector struct { diff --git a/prometheus/gauge.go b/prometheus/gauge.go index e5f6553..2fa255d 100644 --- a/prometheus/gauge.go +++ b/prometheus/gauge.go @@ -16,10 +16,8 @@ import ( // temperature or the hitherto bandwidth used, this would be the metric for such // circumstances. type Gauge interface { - AsMarshallable() map[string]interface{} - ResetAll() + Metric Set(labels map[string]string, value float64) float64 - String() string } type gaugeVector struct { diff --git a/prometheus/histogram.go b/prometheus/histogram.go index ca3ce93..e696f4d 100644 --- a/prometheus/histogram.go +++ b/prometheus/histogram.go @@ -52,10 +52,8 @@ type HistogramSpecification struct { } type Histogram interface { + Metric Add(labels map[string]string, value float64) - AsMarshallable() map[string]interface{} - ResetAll() - String() string } // The histogram is an accumulator for samples. It merely routes into which