use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForDirectMemoryUsed.
@Test
public void includesAGaugeForDirectMemoryUsed() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("direct.used");
when(mBeanServer.getAttribute(direct, "MemoryUsed")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForMappedCount.
@Test
public void includesAGaugeForMappedCount() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("mapped.count");
when(mBeanServer.getAttribute(mapped, "Count")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForMappedCapacity.
@Test
public void includesAGaugeForMappedCapacity() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("mapped.capacity");
when(mBeanServer.getAttribute(mapped, "TotalCapacity")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class ClassLoadingGaugeSetTest method loadedGauge.
@Test
public void loadedGauge() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("loaded");
assertThat(gauge.getValue()).isEqualTo(2L);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class ClassLoadingGaugeSetTest method unLoadedGauge.
@Test
public void unLoadedGauge() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("unloaded");
assertThat(gauge.getValue()).isEqualTo(1L);
}
Aggregations