use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForWeirdMemoryPoolMax.
@Test
public void hasAGaugeForWeirdMemoryPoolMax() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("pools.Weird-Pool.max");
assertThat(gauge.getValue()).isEqualTo(-1L);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForHeapUsed.
@Test
public void hasAGaugeForHeapUsed() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("heap.used");
assertThat(gauge.getValue()).isEqualTo(30L);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForTotalUsed.
@Test
public void hasAGaugeForTotalUsed() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("total.used");
assertThat(gauge.getValue()).isEqualTo(33L);
}
use of com.codahale.metrics.Gauge in project metrics by dropwizard.
the class MemoryUsageGaugeSetTest method hasAGaugeForWeirdMemoryPoolUsage.
@Test
public void hasAGaugeForWeirdMemoryPoolUsage() throws Exception {
final Gauge gauge = (Gauge) gauges.getMetrics().get("pools.Weird-Pool.usage");
assertThat(gauge.getValue()).isEqualTo(3.0);
}
use of com.codahale.metrics.Gauge in project newts by OpenNMS.
the class NewtsReporter method report.
@Override
@SuppressWarnings("rawtypes")
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {
Timestamp timestamp = Timestamp.fromEpochMillis(clock.getTime());
List<Sample> samples = Lists.newArrayList();
for (Map.Entry<String, Gauge> entry : gauges.entrySet()) {
reportGauge(samples, timestamp, entry.getKey(), entry.getValue());
}
for (Map.Entry<String, Counter> entry : counters.entrySet()) {
reportCounter(samples, timestamp, entry.getKey(), entry.getValue());
}
for (Map.Entry<String, Histogram> entry : histograms.entrySet()) {
reportHistogram(samples, timestamp, entry.getKey(), entry.getValue());
}
for (Map.Entry<String, Meter> entry : meters.entrySet()) {
reportMeter(samples, timestamp, entry.getKey(), entry.getValue());
}
for (Map.Entry<String, Timer> entry : timers.entrySet()) {
reportTimer(samples, timestamp, entry.getKey(), entry.getValue());
}
this.repository.insert(samples);
}
Aggregations