-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnop.go
30 lines (25 loc) · 1.02 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
package stats
import (
"time"
"github.com/deixis/spine/log"
)
type nop struct{}
// NopStats returns a stats adapter that does not do anything
func NopStats() Stats {
return &nop{}
}
func (s *nop) Start() {}
func (s *nop) Stop() {}
func (s *nop) SetLogger(l log.Logger) {}
func (s *nop) Count(key string, n interface{}, meta ...map[string]string) {}
func (s *nop) Inc(key string, meta ...map[string]string) {}
func (s *nop) Dec(key string, meta ...map[string]string) {}
func (s *nop) Gauge(key string, n interface{}, meta ...map[string]string) {}
func (s *nop) Timing(key string, t time.Duration, meta ...map[string]string) {}
func (s *nop) Histogram(key string, n interface{}, tags ...map[string]string) {}
func (s *nop) With(meta map[string]string) Stats {
return &nop{}
}
func (s *nop) Log(l log.Logger) Stats {
return &nop{}
}