micro/metrics/reporter.go

22 lines
517 B
Go
Raw Normal View History

2020-08-18 10:30:29 +03:00
// Package metrics is for instrumentation and debugging
package metrics
import (
"time"
"github.com/unistack-org/micro/v3/metadata"
)
var (
DefaultReporter Reporter = NewReporter()
)
2020-08-18 10:30:29 +03:00
// Reporter is an interface for collecting and instrumenting metrics
type Reporter interface {
Init(...Option) error
Count(id string, value int64, md metadata.Metadata) error
Gauge(id string, value float64, md metadata.Metadata) error
Timing(id string, value time.Duration, md metadata.Metadata) error
Options() Options
}