/
noop.go
57 lines (43 loc) · 1.27 KB
/
noop.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
package senders
import (
"github.com/wavefronthq/wavefront-sdk-go/event"
"github.com/wavefronthq/wavefront-sdk-go/histogram"
)
type noOpSender struct {
}
var (
defaultNoopClient Sender = &noOpSender{}
)
// NewWavefrontNoOpClient returns a Wavefront Client instance for which all operations are no-ops.
func NewWavefrontNoOpClient() (Sender, error) {
return defaultNoopClient, nil
}
func (sender *noOpSender) private() {
}
func (sender *noOpSender) Start() {
// no-op
}
func (sender *noOpSender) SendMetric(string, float64, int64, string, map[string]string) error {
return nil
}
func (sender *noOpSender) SendDeltaCounter(string, float64, string, map[string]string) error {
return nil
}
func (sender *noOpSender) SendDistribution(string, []histogram.Centroid, map[histogram.Granularity]bool, int64, string, map[string]string) error {
return nil
}
func (sender *noOpSender) SendSpan(string, int64, int64, string, string, string, []string, []string, []SpanTag, []SpanLog) error {
return nil
}
func (sender *noOpSender) SendEvent(string, int64, int64, string, map[string]string, ...event.Option) error {
return nil
}
func (sender *noOpSender) Close() {
// no-op
}
func (sender *noOpSender) Flush() error {
return nil
}
func (sender *noOpSender) GetFailureCount() int64 {
return 0
}