@Test public void testNOPMetricManager() { Assert.assertTrue(MetricManager.getIMetricManager() instanceof NOPMetricManager); }
@SuppressWarnings("unchecked") public static IMetricManager getIMetricManager() { if (iMetricManager == null) { synchronized (MetricManager.class) { if (iMetricManager == null) { try { Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); Method getSingleton = binderClazz.getMethod("getSingleton"); Object binderObject = getSingleton.invoke(null); Method getMetricManager = binderClazz.getMethod("getMetricManager"); iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); } catch (Exception e) { iMetricManager = NOP_METRIC_MANAGER; } } } } return iMetricManager; }
MetricManager { @SuppressWarnings("unchecked") public static IMetricManager getIMetricManager() { if (iMetricManager == null) { synchronized (MetricManager.class) { if (iMetricManager == null) { try { Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); Method getSingleton = binderClazz.getMethod("getSingleton"); Object binderObject = getSingleton.invoke(null); Method getMetricManager = binderClazz.getMethod("getMetricManager"); iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); } catch (Exception e) { iMetricManager = NOP_METRIC_MANAGER; } } } } return iMetricManager; } }
MetricManager { @SuppressWarnings("unchecked") public static IMetricManager getIMetricManager() { if (iMetricManager == null) { synchronized (MetricManager.class) { if (iMetricManager == null) { try { Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); Method getSingleton = binderClazz.getMethod("getSingleton"); Object binderObject = getSingleton.invoke(null); Method getMetricManager = binderClazz.getMethod("getMetricManager"); iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); } catch (Exception e) { iMetricManager = NOP_METRIC_MANAGER; } } } } return iMetricManager; }  }
MetricManager { @SuppressWarnings("unchecked") public static IMetricManager getIMetricManager() { if (iMetricManager == null) { synchronized (MetricManager.class) { if (iMetricManager == null) { try { Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); Method getSingleton = binderClazz.getMethod("getSingleton"); Object binderObject = getSingleton.invoke(null); Method getMetricManager = binderClazz.getMethod("getMetricManager"); iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); } catch (Exception e) { iMetricManager = NOP_METRIC_MANAGER; } } } } return iMetricManager; }  static Meter getMeter(String group, MetricName name); static Counter getCounter(String group, MetricName name); static Histogram getHistogram(String group, MetricName name); static Histogram getHistogram(String group, MetricName name, ReservoirType type); static Timer getTimer(String group, MetricName name); static Timer getTimer(String group, MetricName name, ReservoirType type); static Compass getCompass(String group, MetricName name); static Compass getCompass(String group, MetricName name, ReservoirType type); static FastCompass getFastCompass(String group, MetricName name); static ClusterHistogram getClusterHistogram(String group, MetricName name, long[] buckets); static ClusterHistogram getClusterHistogram(String group, MetricName name); static void register(String group, MetricName name, Metric metric); @SuppressWarnings("unchecked") static IMetricManager getIMetricManager(); }
MetricManager { @SuppressWarnings("unchecked") public static IMetricManager getIMetricManager() { if (iMetricManager == null) { synchronized (MetricManager.class) { if (iMetricManager == null) { try { Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); Method getSingleton = binderClazz.getMethod("getSingleton"); Object binderObject = getSingleton.invoke(null); Method getMetricManager = binderClazz.getMethod("getMetricManager"); iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); } catch (Exception e) { iMetricManager = NOP_METRIC_MANAGER; } } } } return iMetricManager; }  static Meter getMeter(String group, MetricName name); static Counter getCounter(String group, MetricName name); static Histogram getHistogram(String group, MetricName name); static Histogram getHistogram(String group, MetricName name, ReservoirType type); static Timer getTimer(String group, MetricName name); static Timer getTimer(String group, MetricName name, ReservoirType type); static Compass getCompass(String group, MetricName name); static Compass getCompass(String group, MetricName name, ReservoirType type); static FastCompass getFastCompass(String group, MetricName name); static ClusterHistogram getClusterHistogram(String group, MetricName name, long[] buckets); static ClusterHistogram getClusterHistogram(String group, MetricName name); static void register(String group, MetricName name, Metric metric); @SuppressWarnings("unchecked") static IMetricManager getIMetricManager(); static final IMetricManager NOP_METRIC_MANAGER; }