/
noop.go
22 lines (16 loc) · 1 KB
/
noop.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package metric
import "github.com/pubgo/xerror"
var _ Reporter = (*noopReporter)(nil)
func init() {
xerror.Exit(Register("noop", newNoopReporter))
}
func newNoopReporter(_ map[string]interface{}) (Reporter, error) { return &noopReporter{}, nil }
type noopReporter struct{}
func (n *noopReporter) CreateGauge(opts GaugeOpts) error { return nil }
func (n *noopReporter) CreateCounter(opts CounterOpts) error { return nil }
func (n *noopReporter) CreateSummary(opts SummaryOpts) error { return nil }
func (n *noopReporter) CreateHistogram(opts HistogramOpts) error { return nil }
func (n *noopReporter) Count(name string, value float64, tags Tags) error { return nil }
func (n *noopReporter) Gauge(name string, value float64, tags Tags) error { return nil }
func (n *noopReporter) Histogram(name string, value float64, tags Tags) error { return nil }
func (n *noopReporter) Summary(name string, value float64, tags Tags) error { return nil }