use of com.codahale.metrics.newrelic.transformer.GaugeTransformer in project dropwizard-metrics-newrelic by newrelic.
the class NewRelicReporterTest method setup.
@BeforeEach
void setup() {
commonAttributes = new Attributes().put("name", "the best").put("foo", false);
gaugeTransformer = mock(GaugeTransformer.class);
histogramTransformer = mock(HistogramTransformer.class);
counterTransformer = mock(CounterTransformer.class);
meterTransformer = mock(MeterTransformer.class);
timerTransformer = mock(TimerTransformer.class);
sender = mock(TelemetryClient.class);
timeTracker = mock(TimeTracker.class);
metricRegistry = new MetricRegistry();
}
use of com.codahale.metrics.newrelic.transformer.GaugeTransformer in project dropwizard-metrics-newrelic by newrelic.
the class NewRelicReporterBuilder method build.
public NewRelicReporter build() {
long rateFactor = rateUnit.toSeconds(1);
double durationFactor = durationUnit.toNanos(1);
Predicate<MetricAttribute> metricAttributePredicate = attr -> !disabledMetricAttributes.contains(attr);
TimeTracker timeTracker = new TimeTracker(Clock.defaultClock());
MeterTransformer meterTransformer = MeterTransformer.build(timeTracker, rateFactor, metricAttributePredicate, nameCustomizer, attributeCustomizer);
TimerTransformer timerTransformer = TimerTransformer.build(timeTracker, rateFactor, durationFactor, metricAttributePredicate, nameCustomizer, attributeCustomizer);
GaugeTransformer gaugeTransformer = new GaugeTransformer(nameCustomizer, attributeCustomizer);
CounterTransformer counterTransformer = new CounterTransformer(nameCustomizer, attributeCustomizer);
HistogramTransformer histogramTransformer = HistogramTransformer.build(timeTracker, nameCustomizer, attributeCustomizer);
return new NewRelicReporter(timeTracker, registry, name, filter, rateUnit, durationUnit, new TelemetryClient(metricBatchSender, null, null, null), commonAttributes, histogramTransformer, gaugeTransformer, counterTransformer, meterTransformer, timerTransformer, disabledMetricAttributes);
}
Aggregations