@Test public void unLoadedGauge() throws Exception { final Gauge gauge = (Gauge) gauges.getMetrics().get(MetricName.build("unloaded")); assertThat(gauge.getValue()).isEqualTo(1L); }
@Override public Map<MetricName, Metric> getMetrics() { final Map<MetricName, Metric> gauges = new HashMap<MetricName, Metric>(); gauges.put(MetricName.build("loaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getTotalLoadedClassCount(); } }); gauges.put(MetricName.build("loaded_current"), new PersistentGauge<Integer>() { @Override public Integer getValue() { return mxBean.getLoadedClassCount(); } }); gauges.put(MetricName.build("unloaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getUnloadedClassCount(); } }); return gauges; }
ClassLoadingGaugeSet implements MetricSet { @Override public Map<MetricName, Metric> getMetrics() { final Map<MetricName, Metric> gauges = new HashMap<MetricName, Metric>(); gauges.put(MetricName.build("loaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getTotalLoadedClassCount(); } }); gauges.put(MetricName.build("loaded_current"), new PersistentGauge<Integer>() { @Override public Integer getValue() { return mxBean.getLoadedClassCount(); } }); gauges.put(MetricName.build("unloaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getUnloadedClassCount(); } }); return gauges; } }
ClassLoadingGaugeSet implements MetricSet { @Override public Map<MetricName, Metric> getMetrics() { final Map<MetricName, Metric> gauges = new HashMap<MetricName, Metric>(); gauges.put(MetricName.build("loaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getTotalLoadedClassCount(); } }); gauges.put(MetricName.build("loaded_current"), new PersistentGauge<Integer>() { @Override public Integer getValue() { return mxBean.getLoadedClassCount(); } }); gauges.put(MetricName.build("unloaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getUnloadedClassCount(); } }); return gauges; } ClassLoadingGaugeSet();  ClassLoadingGaugeSet(ClassLoadingMXBean mxBean); }
ClassLoadingGaugeSet implements MetricSet { @Override public Map<MetricName, Metric> getMetrics() { final Map<MetricName, Metric> gauges = new HashMap<MetricName, Metric>(); gauges.put(MetricName.build("loaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getTotalLoadedClassCount(); } }); gauges.put(MetricName.build("loaded_current"), new PersistentGauge<Integer>() { @Override public Integer getValue() { return mxBean.getLoadedClassCount(); } }); gauges.put(MetricName.build("unloaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getUnloadedClassCount(); } }); return gauges; } ClassLoadingGaugeSet();  ClassLoadingGaugeSet(ClassLoadingMXBean mxBean); @Override Map<MetricName, Metric> getMetrics(); @Override long lastUpdateTime(); }
ClassLoadingGaugeSet implements MetricSet { @Override public Map<MetricName, Metric> getMetrics() { final Map<MetricName, Metric> gauges = new HashMap<MetricName, Metric>(); gauges.put(MetricName.build("loaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getTotalLoadedClassCount(); } }); gauges.put(MetricName.build("loaded_current"), new PersistentGauge<Integer>() { @Override public Integer getValue() { return mxBean.getLoadedClassCount(); } }); gauges.put(MetricName.build("unloaded"), new PersistentGauge<Long>() { @Override public Long getValue() { return mxBean.getUnloadedClassCount(); } }); return gauges; } ClassLoadingGaugeSet();  ClassLoadingGaugeSet(ClassLoadingMXBean mxBean); @Override Map<MetricName, Metric> getMetrics(); @Override long lastUpdateTime();  }