Revision 7f607d0ce23d5c578325b2d2a6bfe2273191cf9b authored by Mauricio Serna on 11 January 2019, 22:41:02 UTC, committed by Ethan Buchman on 11 January 2019, 22:41:02 UTC
1 parent 81c51cd
metrics.go
package state
import (
"github.com/go-kit/kit/metrics"
"github.com/go-kit/kit/metrics/discard"
"github.com/go-kit/kit/metrics/prometheus"
stdprometheus "github.com/prometheus/client_golang/prometheus"
)
const MetricsSubsystem = "state"
type Metrics struct {
// Time between BeginBlock and EndBlock.
BlockProcessingTime metrics.Histogram
}
func PrometheusMetrics(namespace string) *Metrics {
return &Metrics{
BlockProcessingTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "block_processing_time",
Help: "Time between BeginBlock and EndBlock in ms.",
Buckets: stdprometheus.LinearBuckets(1, 10, 10),
}, []string{}),
}
}
func NopMetrics() *Metrics {
return &Metrics{
BlockProcessingTime: discard.NewHistogram(),
}
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...