-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock_telemetry.go
51 lines (40 loc) · 956 Bytes
/
mock_telemetry.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
package log
import (
"time"
)
type mockTelemetry struct {
Logger Logger
Tags Tags
Start time.Time
}
func (m *mockTelemetry) Gauge(_ string, _ float64, _ ...interface{}) Logger {
return m.Logger
}
func (m *mockTelemetry) Fix(_ string, _ float64, _ ...interface{}) Logger {
return m.Logger
}
func (m *mockTelemetry) Histogram(_ string, _ float64, _ ...interface{}) Logger {
return m.Logger
}
func (m *mockTelemetry) SetLogger(l Logger) {
m.Logger = l
}
func (m *mockTelemetry) Inc(_ string, _ float64, _ ...interface{}) Logger {
return m.Logger
}
func (m *mockTelemetry) Summary(_ string, _ float64, _ ...interface{}) Logger {
return m.Logger
}
func (m *mockTelemetry) WithTag(k, v string) Telemetry {
//TODO Remove this check. It should not be necessary
if m.Tags == nil {
}
return m
}
func (m *mockTelemetry) WithTags(t Tags) Telemetry {
return m
}
func (m mockTelemetry) Clone() Telemetry {
m.Start = time.Now()
return &m
}