forked from mirror/client_golang
Metrics explicitly implement Metric interface
This commit is contained in:
parent
c39c592874
commit
0b30e065c8
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue