Search in sources :

Example 16 with Metric

use of com.newrelic.telemetry.metrics.Metric in project dropwizard-metrics-newrelic by newrelic.

the class CounterTransformerTest method testFirstTimeSeen.

@Test
void testFirstTimeSeen() {
    Counter counter = new Counter();
    counter.inc(44);
    Gauge expected = new Gauge(COUNTER_NAME, 44, timestamp, EMPTY_ATTRIBUTES);
    CounterTransformer converter = new CounterTransformer(clock);
    Collection<Metric> result = converter.transform(COUNTER_NAME, counter);
    assertEquals(singleton(expected), result);
}
Also used : Counter(com.codahale.metrics.Counter) Metric(com.newrelic.telemetry.metrics.Metric) Gauge(com.newrelic.telemetry.metrics.Gauge) Test(org.junit.jupiter.api.Test)

Aggregations

Metric (com.newrelic.telemetry.metrics.Metric)16 Test (org.junit.jupiter.api.Test)14 Attributes (com.newrelic.telemetry.Attributes)13 Gauge (com.newrelic.telemetry.metrics.Gauge)8 Count (com.newrelic.telemetry.metrics.Count)7 Gauge (com.codahale.metrics.Gauge)4 Histogram (com.codahale.metrics.Histogram)3 RatioGauge (com.codahale.metrics.RatioGauge)3 Counter (com.codahale.metrics.Counter)2 ExponentiallyDecayingReservoir (com.codahale.metrics.ExponentiallyDecayingReservoir)2 Meter (com.codahale.metrics.Meter)2 Snapshot (com.codahale.metrics.Snapshot)2 Timer (com.codahale.metrics.Timer)2 CountingTransformer (com.codahale.metrics.newrelic.transformer.interfaces.CountingTransformer)2 MeteredTransformer (com.codahale.metrics.newrelic.transformer.interfaces.MeteredTransformer)2 SamplingTransformer (com.codahale.metrics.newrelic.transformer.interfaces.SamplingTransformer)2 TimeTracker (com.codahale.metrics.newrelic.util.TimeTracker)2 Summary (com.newrelic.telemetry.metrics.Summary)2 Clock (com.codahale.metrics.Clock)1 Ratio (com.codahale.metrics.RatioGauge.Ratio)1