Showing
2 changed files
with
17 additions
and
2 deletions
... | @@ -70,6 +70,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -70,6 +70,7 @@ public final class MetricsManager implements MetricsService { |
70 | * @param name name of the Component to register | 70 | * @param name name of the Component to register |
71 | * @return MetricsComponent object that can be used to create Metrics. | 71 | * @return MetricsComponent object that can be used to create Metrics. |
72 | */ | 72 | */ |
73 | + @Override | ||
73 | public MetricsComponent registerComponent(final String name) { | 74 | public MetricsComponent registerComponent(final String name) { |
74 | MetricsComponent component = componentsRegistry.get(name); | 75 | MetricsComponent component = componentsRegistry.get(name); |
75 | if (component == null) { | 76 | if (component == null) { |
... | @@ -91,7 +92,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -91,7 +92,7 @@ public final class MetricsManager implements MetricsService { |
91 | * | 92 | * |
92 | * @return full name of the metric | 93 | * @return full name of the metric |
93 | */ | 94 | */ |
94 | - public String generateName(final MetricsComponent component, | 95 | + private String generateName(final MetricsComponent component, |
95 | final MetricsFeature feature, | 96 | final MetricsFeature feature, |
96 | final String metricName) { | 97 | final String metricName) { |
97 | return MetricRegistry.name(component.getName(), | 98 | return MetricRegistry.name(component.getName(), |
... | @@ -107,6 +108,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -107,6 +108,7 @@ public final class MetricsManager implements MetricsService { |
107 | * @param metricName local name of the metric | 108 | * @param metricName local name of the metric |
108 | * @return the created Counter Meteric | 109 | * @return the created Counter Meteric |
109 | */ | 110 | */ |
111 | + @Override | ||
110 | public Counter createCounter(final MetricsComponent component, | 112 | public Counter createCounter(final MetricsComponent component, |
111 | final MetricsFeature feature, | 113 | final MetricsFeature feature, |
112 | final String metricName) { | 114 | final String metricName) { |
... | @@ -122,6 +124,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -122,6 +124,7 @@ public final class MetricsManager implements MetricsService { |
122 | * @param metricName local name of the metric | 124 | * @param metricName local name of the metric |
123 | * @return the created Histogram Metric | 125 | * @return the created Histogram Metric |
124 | */ | 126 | */ |
127 | + @Override | ||
125 | public Histogram createHistogram(final MetricsComponent component, | 128 | public Histogram createHistogram(final MetricsComponent component, |
126 | final MetricsFeature feature, | 129 | final MetricsFeature feature, |
127 | final String metricName) { | 130 | final String metricName) { |
... | @@ -137,6 +140,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -137,6 +140,7 @@ public final class MetricsManager implements MetricsService { |
137 | * @param metricName local name of the metric | 140 | * @param metricName local name of the metric |
138 | * @return the created Timer Metric | 141 | * @return the created Timer Metric |
139 | */ | 142 | */ |
143 | + @Override | ||
140 | public Timer createTimer(final MetricsComponent component, | 144 | public Timer createTimer(final MetricsComponent component, |
141 | final MetricsFeature feature, | 145 | final MetricsFeature feature, |
142 | final String metricName) { | 146 | final String metricName) { |
... | @@ -152,6 +156,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -152,6 +156,7 @@ public final class MetricsManager implements MetricsService { |
152 | * @param metricName local name of the metric | 156 | * @param metricName local name of the metric |
153 | * @return the created Meter Metric | 157 | * @return the created Meter Metric |
154 | */ | 158 | */ |
159 | + @Override | ||
155 | public Meter createMeter(final MetricsComponent component, | 160 | public Meter createMeter(final MetricsComponent component, |
156 | final MetricsFeature feature, | 161 | final MetricsFeature feature, |
157 | final String metricName) { | 162 | final String metricName) { |
... | @@ -171,6 +176,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -171,6 +176,7 @@ public final class MetricsManager implements MetricsService { |
171 | * @param metric Metric to register | 176 | * @param metric Metric to register |
172 | * @return the registered Metric | 177 | * @return the registered Metric |
173 | */ | 178 | */ |
179 | + @Override | ||
174 | public <T extends Metric> T registerMetric( | 180 | public <T extends Metric> T registerMetric( |
175 | final MetricsComponent component, | 181 | final MetricsComponent component, |
176 | final MetricsFeature feature, | 182 | final MetricsFeature feature, |
... | @@ -188,6 +194,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -188,6 +194,7 @@ public final class MetricsManager implements MetricsService { |
188 | * @return a map of the Timers that match the filter, with the key as the | 194 | * @return a map of the Timers that match the filter, with the key as the |
189 | * name String to the Timer. | 195 | * name String to the Timer. |
190 | */ | 196 | */ |
197 | + @Override | ||
191 | public Map<String, Timer> getTimers(final MetricFilter filter) { | 198 | public Map<String, Timer> getTimers(final MetricFilter filter) { |
192 | return metricsRegistry.getTimers(filter); | 199 | return metricsRegistry.getTimers(filter); |
193 | } | 200 | } |
... | @@ -199,7 +206,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -199,7 +206,7 @@ public final class MetricsManager implements MetricsService { |
199 | * @return a map of the Gauges that match the filter, with the key as the | 206 | * @return a map of the Gauges that match the filter, with the key as the |
200 | * name String to the Gauge. | 207 | * name String to the Gauge. |
201 | */ | 208 | */ |
202 | - @SuppressWarnings("rawtypes") | 209 | + @Override |
203 | public Map<String, Gauge> getGauges(final MetricFilter filter) { | 210 | public Map<String, Gauge> getGauges(final MetricFilter filter) { |
204 | return metricsRegistry.getGauges(filter); | 211 | return metricsRegistry.getGauges(filter); |
205 | } | 212 | } |
... | @@ -211,6 +218,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -211,6 +218,7 @@ public final class MetricsManager implements MetricsService { |
211 | * @return a map of the Counters that match the filter, with the key as the | 218 | * @return a map of the Counters that match the filter, with the key as the |
212 | * name String to the Counter. | 219 | * name String to the Counter. |
213 | */ | 220 | */ |
221 | + @Override | ||
214 | public Map<String, Counter> getCounters(final MetricFilter filter) { | 222 | public Map<String, Counter> getCounters(final MetricFilter filter) { |
215 | return metricsRegistry.getCounters(filter); | 223 | return metricsRegistry.getCounters(filter); |
216 | } | 224 | } |
... | @@ -222,6 +230,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -222,6 +230,7 @@ public final class MetricsManager implements MetricsService { |
222 | * @return a map of the Meters that match the filter, with the key as the | 230 | * @return a map of the Meters that match the filter, with the key as the |
223 | * name String to the Meter. | 231 | * name String to the Meter. |
224 | */ | 232 | */ |
233 | + @Override | ||
225 | public Map<String, Meter> getMeters(final MetricFilter filter) { | 234 | public Map<String, Meter> getMeters(final MetricFilter filter) { |
226 | return metricsRegistry.getMeters(filter); | 235 | return metricsRegistry.getMeters(filter); |
227 | } | 236 | } |
... | @@ -233,6 +242,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -233,6 +242,7 @@ public final class MetricsManager implements MetricsService { |
233 | * @return a map of the Histograms that match the filter, with the key as the | 242 | * @return a map of the Histograms that match the filter, with the key as the |
234 | * name String to the Histogram. | 243 | * name String to the Histogram. |
235 | */ | 244 | */ |
245 | + @Override | ||
236 | public Map<String, Histogram> getHistograms(final MetricFilter filter) { | 246 | public Map<String, Histogram> getHistograms(final MetricFilter filter) { |
237 | return metricsRegistry.getHistograms(filter); | 247 | return metricsRegistry.getHistograms(filter); |
238 | } | 248 | } |
... | @@ -242,6 +252,7 @@ public final class MetricsManager implements MetricsService { | ... | @@ -242,6 +252,7 @@ public final class MetricsManager implements MetricsService { |
242 | * | 252 | * |
243 | * @param filter filter to use to select the Metrics to remove. | 253 | * @param filter filter to use to select the Metrics to remove. |
244 | */ | 254 | */ |
255 | + @Override | ||
245 | public void removeMatching(final MetricFilter filter) { | 256 | public void removeMatching(final MetricFilter filter) { |
246 | metricsRegistry.removeMatching(filter); | 257 | metricsRegistry.removeMatching(filter); |
247 | } | 258 | } | ... | ... |
... | @@ -59,6 +59,10 @@ interface MetricsService { | ... | @@ -59,6 +59,10 @@ interface MetricsService { |
59 | MetricsFeature feature, | 59 | MetricsFeature feature, |
60 | String metricName); | 60 | String metricName); |
61 | 61 | ||
62 | + Meter createMeter(MetricsComponent component, | ||
63 | + MetricsFeature feature, | ||
64 | + String metricName); | ||
65 | + | ||
62 | /** | 66 | /** |
63 | * Registers an already created Metric. This is used for situation where a | 67 | * Registers an already created Metric. This is used for situation where a |
64 | * caller needs to allocate its own Metric, but still register it with the | 68 | * caller needs to allocate its own Metric, but still register it with the | ... | ... |
-
Please register or login to post a comment