Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2771#discussion_r204861682
--- Diff:
storm-server/src/main/java/org/apache/storm/metric/StormMetricsRegistry.java ---
@@ -65,21 +67,41 @@ public static Meter registerMeter(final String name) {
* @param <V> type of value the gauge measures
*/
public static <V> void registerProvidedGauge(final String name, final
Gauge<V> gauge) {
- register(name, gauge);
+ DEFAULT_REGISTRY.register(name, gauge);
+ }
+
+ public static Histogram registerHistogram(String name) {
+ return registerHistogram(name, new
ExponentiallyDecayingReservoir());
}
public static Histogram registerHistogram(String name, Reservoir
reservoir) {
- return register(name, new Histogram(reservoir));
+ return DEFAULT_REGISTRY.register(name, new Histogram(reservoir));
+ }
+
+ public static Meter registerMeter(String name) {
+ return DEFAULT_REGISTRY.register(name, new Meter());
+ }
+
+ //Change the name to avoid name conflict in future Metrics release
+ public static void registerMetricSet(MetricSet metrics) {
+ DEFAULT_REGISTRY.registerAll(metrics);
}
- public static void registerAll(final String prefix, MetricSet metrics)
{
- register(prefix, metrics);
+ public static void unregisterMetricSet(com.codahale.metrics.MetricSet
metrics) {
--- End diff --
Fully qualified class name seems unnecessary.
---