1
0

noopclient.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package statsd
  2. //@author https://github.com/wyndhblb/statsd
  3. import (
  4. "time"
  5. "github.com/quipo/statsd/event"
  6. )
  7. // NoopClient implements a "no-op" statsd in case there is no statsd server
  8. type NoopClient struct{}
  9. // CreateSocket does nothing
  10. func (s NoopClient) CreateSocket() error {
  11. return nil
  12. }
  13. // CreateTCPSocket does nothing
  14. func (s NoopClient) CreateTCPSocket() error {
  15. return nil
  16. }
  17. // Close does nothing
  18. func (s NoopClient) Close() error {
  19. return nil
  20. }
  21. // Incr does nothing
  22. func (s NoopClient) Incr(stat string, count int64) error {
  23. return nil
  24. }
  25. // Decr does nothing
  26. func (s NoopClient) Decr(stat string, count int64) error {
  27. return nil
  28. }
  29. // Timing does nothing
  30. func (s NoopClient) Timing(stat string, count int64) error {
  31. return nil
  32. }
  33. // PrecisionTiming does nothing
  34. func (s NoopClient) PrecisionTiming(stat string, delta time.Duration) error {
  35. return nil
  36. }
  37. // Gauge does nothing
  38. func (s NoopClient) Gauge(stat string, value int64) error {
  39. return nil
  40. }
  41. // GaugeDelta does nothing
  42. func (s NoopClient) GaugeDelta(stat string, value int64) error {
  43. return nil
  44. }
  45. // Absolute does nothing
  46. func (s NoopClient) Absolute(stat string, value int64) error {
  47. return nil
  48. }
  49. // Total does nothing
  50. func (s NoopClient) Total(stat string, value int64) error {
  51. return nil
  52. }
  53. // FGauge does nothing
  54. func (s NoopClient) FGauge(stat string, value float64) error {
  55. return nil
  56. }
  57. // FGaugeDelta does nothing
  58. func (s NoopClient) FGaugeDelta(stat string, value float64) error {
  59. return nil
  60. }
  61. // FAbsolute does nothing
  62. func (s NoopClient) FAbsolute(stat string, value float64) error {
  63. return nil
  64. }
  65. // SendEvents does nothing
  66. func (s NoopClient) SendEvents(events map[string]event.Event) error {
  67. return nil
  68. }