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.
|
// TODO(matt): Refactor to de-duplicate behaviors.
|
||||||
|
|
||||||
type Counter interface {
|
type Counter interface {
|
||||||
AsMarshallable() map[string]interface{}
|
Metric
|
||||||
|
|
||||||
Decrement(labels map[string]string) float64
|
Decrement(labels map[string]string) float64
|
||||||
DecrementBy(labels map[string]string, value float64) float64
|
DecrementBy(labels map[string]string, value float64) float64
|
||||||
Increment(labels map[string]string) float64
|
Increment(labels map[string]string) float64
|
||||||
IncrementBy(labels map[string]string, value float64) float64
|
IncrementBy(labels map[string]string, value float64) float64
|
||||||
ResetAll()
|
|
||||||
Set(labels map[string]string, value float64) float64
|
Set(labels map[string]string, value float64) float64
|
||||||
String() string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type counterVector struct {
|
type counterVector struct {
|
||||||
|
|
|
@ -16,10 +16,8 @@ import (
|
||||||
// temperature or the hitherto bandwidth used, this would be the metric for such
|
// temperature or the hitherto bandwidth used, this would be the metric for such
|
||||||
// circumstances.
|
// circumstances.
|
||||||
type Gauge interface {
|
type Gauge interface {
|
||||||
AsMarshallable() map[string]interface{}
|
Metric
|
||||||
ResetAll()
|
|
||||||
Set(labels map[string]string, value float64) float64
|
Set(labels map[string]string, value float64) float64
|
||||||
String() string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type gaugeVector struct {
|
type gaugeVector struct {
|
||||||
|
|
|
@ -52,10 +52,8 @@ type HistogramSpecification struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Histogram interface {
|
type Histogram interface {
|
||||||
|
Metric
|
||||||
Add(labels map[string]string, value float64)
|
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
|
// The histogram is an accumulator for samples. It merely routes into which
|
||||||
|
|
Loading…
Reference in New Issue