core/metrics/nop.go
2022-03-16 21:21:47 +08:00

24 lines
447 B
Go

package metrics
var (
nilGauge = &nopGauge{}
nilCounter = &nopCounter{}
nilObserver = &nopObserver{}
)
type nopGauge struct{}
func (*nopGauge) Inc() {}
func (*nopGauge) Dec() {}
func (*nopGauge) Add(v float64) {}
func (*nopGauge) Set(v float64) {}
type nopCounter struct{}
func (*nopCounter) Inc() {}
func (*nopCounter) Add(v float64) {}
type nopObserver struct{}
func (*nopObserver) Observe(v float64) {}