blob: bfd603fabe40785e106b72dff3a31bd53f2a5727 [file] [log] [blame]
Ray Milkey26921af2014-06-30 16:27:40 -07001package net.onrc.onos.core.metrics;
2
3import com.codahale.metrics.MetricRegistry;
4
5/**
6 * This class acts a singleton to hold the Metrics registry for ONOS.
7 */
8public final class OnosMetrics {
9
10 /**
11 * Hide constructor. The only way to get the registry is through the
12 * singleton getter.
13 */
14 private OnosMetrics() {}
15
16 private static final MetricRegistry METRICS_REGISTRY = new MetricRegistry();
17
18 /**
19 * Get the singleton Metrics registry. A single instance of
20 * the registry is statically allocated and then used by all callers.
21 *
22 * @return Metrics registry
23 */
24 public static MetricRegistry getMetricsRegistry() {
25 return METRICS_REGISTRY;
26 }
27}
28