aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/core/metrics/nop/counter.go
blob: 65a36910da10211bb025aa4528364c4e08e78f79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package nop

import "github.com/ydb-platform/ydb/library/go/core/metrics"

var _ metrics.Counter = (*Counter)(nil)

type Counter struct{}

func (Counter) Inc() {}

func (Counter) Add(_ int64) {}

var _ metrics.CounterVec = (*CounterVec)(nil)

type CounterVec struct{}

func (t CounterVec) With(_ map[string]string) metrics.Counter {
	return Counter{}
}

func (t CounterVec) Reset() {}

var _ metrics.FuncCounter = (*FuncCounter)(nil)

type FuncCounter struct {
	function func() int64
}

func (c FuncCounter) Function() func() int64 {
	return c.function
}