1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.omid.metrics;
19
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22
23 public class NullMetricsProvider implements MetricsProvider, MetricsRegistry {
24
25 private static final Logger LOG = LoggerFactory.getLogger(NullMetricsProvider.class);
26
27 public NullMetricsProvider() {
28 }
29
30
31
32 @Override
33 public void startMetrics() {
34 LOG.info("Null metrics provider started");
35 }
36
37 @Override
38 public void stopMetrics() {
39 LOG.info("Null metrics provider stopped");
40 }
41
42
43
44 @Override
45 public <T extends Number> void gauge(String name, Gauge<T> gauge) {
46 }
47
48 @Override
49 public Counter counter(final String name) {
50 return new Counter() {
51
52 @Override
53 public void inc() {
54
55 }
56
57 @Override
58 public void inc(long n) {
59
60 }
61
62 @Override
63 public void dec() {
64
65 }
66
67 @Override
68 public void dec(long n) {
69
70 }
71
72 };
73
74 }
75
76 @Override
77 public Timer timer(final String name) {
78
79 return new Timer() {
80 @Override
81 public void start() {
82
83 }
84
85 @Override
86 public void stop() {
87
88 }
89
90 @Override
91 public void update(long duration) {
92
93 }
94 };
95
96 }
97
98 @Override
99 public Meter meter(final String name) {
100
101 return new Meter() {
102
103 @Override
104 public void mark() {
105
106 }
107
108 @Override
109 public void mark(long n) {
110
111 }
112
113 };
114 }
115
116 @Override
117 public Histogram histogram(final String name) {
118
119 return new Histogram() {
120
121 @Override
122 public void update(long value) {
123
124 }
125
126 @Override
127 public void update(int value) {
128
129 }
130 };
131 }
132
133
134
135 }