ipld-eth-server/vendor/github.com/ipfs/go-metrics-interface/interface.go
Elizabeth Engelman 36533f7c3f Update vendor directory and make necessary code changes
Fixes for new geth version
2019-09-25 16:32:27 -05:00

46 lines
826 B
Go

package metrics
import (
"time"
)
// Increment only metric
type Counter interface {
Inc()
Add(float64) // Only positive
}
// Increse and decrese metric
type Gauge interface {
Set(float64) // Introduced discontinuity
Inc()
Dec()
Add(float64)
Sub(float64)
}
type Histogram interface {
Observe(float64) // Adds observation to Histogram
}
type Summary interface {
Observe(float64) // Adds observation to Summary
}
// Consult http://godoc.org/github.com/prometheus/client_golang/prometheus#SummaryOpts
type SummaryOpts struct {
Objectives map[float64]float64
MaxAge time.Duration
AgeBuckets uint32
BufCap uint32
}
type Creator interface {
Counter() Counter
Gauge() Gauge
Histogram(buckets []float64) Histogram
// opts cannot be nil, use empty summary instance
Summary(opts SummaryOpts) Summary
}