aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/core/metrics/nop/gauge.go
blob: 9ab9ff6d772bc31ce07bc9bf487ecaa2d8a86864 (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.Gauge = (*Gauge)(nil)

type Gauge struct{}

func (Gauge) Set(_ float64) {}

func (Gauge) Add(_ float64) {}

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

type GaugeVec struct{}

func (t GaugeVec) With(_ map[string]string) metrics.Gauge {
	return Gauge{}
}

func (t GaugeVec) Reset() {}

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

type FuncGauge struct {
	function func() float64
}

func (g FuncGauge) Function() func() float64 {
	return g.function
}