github.com/mailru/activerecord@v1.12.2/pkg/activerecord/metrics.go (about) 1 package activerecord 2 3 import "context" 4 5 type DefaultNoopMetric struct{} 6 7 func NewDefaultNoopMetric() *DefaultNoopMetric { 8 return &DefaultNoopMetric{} 9 } 10 11 func (*DefaultNoopMetric) Timer(storage, entity string) MetricTimerInterface { 12 return &DefaultNoopMetricTimer{} 13 } 14 15 func (*DefaultNoopMetric) StatCount(storage, entity string) MetricStatCountInterface { 16 return &DefaultNoopMetricCount{} 17 } 18 19 func (*DefaultNoopMetric) ErrorCount(storage, entity string) MetricStatCountInterface { 20 return &DefaultNoopMetricCount{} 21 } 22 23 type DefaultNoopMetricTimer struct{} 24 25 func (*DefaultNoopMetricTimer) Timing(ctx context.Context, name string) {} 26 func (*DefaultNoopMetricTimer) Finish(ctx context.Context, name string) {} 27 28 type DefaultNoopMetricCount struct{} 29 30 func (*DefaultNoopMetricCount) Inc(ctx context.Context, name string, val float64) {}