Search in sources :

Example 6 with Gauge

use of com.codahale.metrics.Gauge in project metrics by dropwizard.

the class MemoryUsageGaugeSetTest method hasAGaugeForHeapCommitted.

@Test
public void hasAGaugeForHeapCommitted() throws Exception {
    final Gauge gauge = (Gauge) gauges.getMetrics().get("heap.committed");
    assertThat(gauge.getValue()).isEqualTo(10L);
}
Also used : Gauge(com.codahale.metrics.Gauge) Test(org.junit.Test)

Example 7 with Gauge

use of com.codahale.metrics.Gauge in project metrics by dropwizard.

the class GarbageCollectorMetricSetTest method hasAGaugeForGcCounts.

@Test
public void hasAGaugeForGcCounts() throws Exception {
    final Gauge gauge = (Gauge) metrics.getMetrics().get("PS-OldGen.count");
    assertThat(gauge.getValue()).isEqualTo(1L);
}
Also used : Gauge(com.codahale.metrics.Gauge) Test(org.junit.Test)

Example 8 with Gauge

use of com.codahale.metrics.Gauge in project metrics by dropwizard.

the class MemoryUsageGaugeSetTest method hasAGaugeForHeapInit.

@Test
public void hasAGaugeForHeapInit() throws Exception {
    final Gauge gauge = (Gauge) gauges.getMetrics().get("heap.init");
    assertThat(gauge.getValue()).isEqualTo(20L);
}
Also used : Gauge(com.codahale.metrics.Gauge) Test(org.junit.Test)

Example 9 with Gauge

use of com.codahale.metrics.Gauge in project metrics by dropwizard.

the class MemoryUsageGaugeSetTest method hasAGaugeForTotalInit.

@Test
public void hasAGaugeForTotalInit() throws Exception {
    final Gauge gauge = (Gauge) gauges.getMetrics().get("total.init");
    assertThat(gauge.getValue()).isEqualTo(22L);
}
Also used : Gauge(com.codahale.metrics.Gauge) Test(org.junit.Test)

Example 10 with Gauge

use of com.codahale.metrics.Gauge in project metrics by dropwizard.

the class MemoryUsageGaugeSetTest method hasAGaugeForNonHeapInit.

@Test
public void hasAGaugeForNonHeapInit() throws Exception {
    final Gauge gauge = (Gauge) gauges.getMetrics().get("non-heap.init");
    assertThat(gauge.getValue()).isEqualTo(2L);
}
Also used : Gauge(com.codahale.metrics.Gauge) Test(org.junit.Test)

Aggregations

Gauge (com.codahale.metrics.Gauge)57 Test (org.junit.Test)38 Counter (com.codahale.metrics.Counter)10 Meter (com.codahale.metrics.Meter)8 Metric (com.codahale.metrics.Metric)8 Timer (com.codahale.metrics.Timer)7 SortedMap (java.util.SortedMap)7 Histogram (com.codahale.metrics.Histogram)6 MetricRegistry (com.codahale.metrics.MetricRegistry)6 Map (java.util.Map)6 Matchers.anyString (org.mockito.Matchers.anyString)3 Snapshot (com.codahale.metrics.Snapshot)2 Date (java.util.Date)2 HashMap (java.util.HashMap)2 TreeMap (java.util.TreeMap)2 Semaphore (java.util.concurrent.Semaphore)2 SolrMetricManager (org.apache.solr.metrics.SolrMetricManager)2 SolrQueryRequest (org.apache.solr.request.SolrQueryRequest)2 AsmGauge (com.alibaba.jstorm.common.metric.AsmGauge)1 MetricSet (com.codahale.metrics.MetricSet)1