OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-kit / kit / metrics / discard / discard.go
1 // Package discard provides a no-op metrics backend.
2 package discard
3
4 import "github.com/go-kit/kit/metrics"
5
6 type counter struct{}
7
8 // NewCounter returns a new no-op counter.
9 func NewCounter() metrics.Counter { return counter{} }
10
11 // With implements Counter.
12 func (c counter) With(labelValues ...string) metrics.Counter { return c }
13
14 // Add implements Counter.
15 func (c counter) Add(delta float64) {}
16
17 type gauge struct{}
18
19 // NewGauge returns a new no-op gauge.
20 func NewGauge() metrics.Gauge { return gauge{} }
21
22 // With implements Gauge.
23 func (g gauge) With(labelValues ...string) metrics.Gauge { return g }
24
25 // Set implements Gauge.
26 func (g gauge) Set(value float64) {}
27
28 // Add implements metrics.Gauge.
29 func (g gauge) Add(delta float64) {}
30
31 type histogram struct{}
32
33 // NewHistogram returns a new no-op histogram.
34 func NewHistogram() metrics.Histogram { return histogram{} }
35
36 // With implements Histogram.
37 func (h histogram) With(labelValues ...string) metrics.Histogram { return h }
38
39 // Observe implements histogram.
40 func (h histogram) Observe(value float64) {}