use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForDirectCount.
@Test
public void includesAGaugeForDirectCount() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("direct.count");
when(mBeanServer.getAttribute(direct, "Count")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForDirectCapacity.
@Test
public void includesAGaugeForDirectCapacity() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("direct.capacity");
when(mBeanServer.getAttribute(direct, "TotalCapacity")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class BufferPoolMetricSetTest method includesAGaugeForMappedMemoryUsed.
@Test
public void includesAGaugeForMappedMemoryUsed() throws Exception {
final Gauge gauge = (Gauge) buffers.getMetrics().get("mapped.used");
when(mBeanServer.getAttribute(mapped, "MemoryUsed")).thenReturn(100);
assertThat(gauge.getValue()).isEqualTo(100);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForHeapUsage.
@Test
public void hasAGaugeForHeapUsage() {
final Gauge gauge = (Gauge) gauges.getMetrics().get("heap.usage");
assertThat(gauge.getValue()).isEqualTo(0.75);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForTotalMax.
@Test
public void hasAGaugeForTotalMax() {
final Gauge gauge = (Gauge) gauges.getMetrics().get("total.max");
assertThat(gauge.getValue()).isEqualTo(44L);
}
Aggregations