forked from vulcand/vulcand
/
nop.go
61 lines (45 loc) · 1.19 KB
/
nop.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package metrics
import (
"time"
)
// nopclient does nothing when called, useful in tests
type nopclient struct {
}
func (s *nopclient) Close() error {
return nil
}
func (s *nopclient) Inc(stat interface{}, value int64, rate float32) error {
return nil
}
func (s *nopclient) Dec(stat interface{}, value int64, rate float32) error {
return nil
}
func (s *nopclient) Gauge(stat interface{}, value int64, rate float32) error {
return nil
}
func (s *nopclient) GaugeDelta(stat interface{}, value int64, rate float32) error {
return nil
}
func (s *nopclient) Timing(stat interface{}, delta int64, rate float32) error {
return nil
}
func (s *nopclient) UniqueString(stat interface{}, value string, rate float32) error {
return nil
}
func (s *nopclient) UniqueInt64(stat interface{}, value int64, rate float32) error {
return nil
}
func (s *nopclient) SetPrefix(prefix string) {
}
func (s *nopclient) TimingMs(stat interface{}, d time.Duration, rate float32) error {
return nil
}
func (s *nopclient) ReportRuntimeMetrics(prefix string, rate float32) error {
return nil
}
func (s *nopclient) Metric(p ...string) Metric {
return NewMetric("", p...)
}
func NewNop() Client {
return &nopclient{}
}