Documentation ¶
Overview ¶
Package metricsreporter provides a reporter for metrics data collected by package "github.com/rcrowley/go-metrics".
This is a reporter for package "github.com/rcrowley/go-metrics" which will submit the metrics to a metrics.Interface. See:
https://godoc.org/github.com/rcrowley/go-metrics https://godoc.org/bitbucket.org/pcas/metrics
Example usage:
import ( "bitbucket.org/pcas/metrics/metricsreporter" "bitbucket.org/pcastools/log" "github.com/rcrowley/go-metrics" ) defer metricsreporter.Register( m, // The destination metrics.Interface metrics.DefaultRegistry, // The source go-metrics.Registry 10 * time.Second, // The reporting interval log.Stderr, // Log any errors to stderr ).Stop()
Index ¶
Constants ¶
View Source
const DefaultInterval = 10 * time.Second
DefaultInterval is the default reporting interval.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter links a go-metrics.Registry to a metrics.Interface.
func Register ¶
func Register(m metrics.Interface, r gometrics.Registry, interval time.Duration, l log.Interface) *Reporter
Register starts submitting metrics from the registry to the metrics.Interface, reporting with given interval. If the interval is <= 0 then DefaultInterval will be used. Any errors submitting metrics will be logged to l.
Click to show internal directories.
Click to hide internal directories.