Metrics explicitly implement Metric interface

This commit is contained in:
Bernerd Schaefer 2013-04-19 13:22:59 +02:00
parent c39c592874
commit 0b30e065c8
3 changed files with 4 additions and 9 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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