Search in sources :

Example 1 with TelemetryClient

use of com.newrelic.telemetry.TelemetryClient 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);
}
Also used : Clock(com.codahale.metrics.Clock) TimeTracker(com.codahale.metrics.newrelic.util.TimeTracker) MetricRegistry(com.codahale.metrics.MetricRegistry) MetricAttributesCustomizer(com.codahale.metrics.newrelic.transformer.customizer.MetricAttributesCustomizer) TelemetryClient(com.newrelic.telemetry.TelemetryClient) TimerTransformer(com.codahale.metrics.newrelic.transformer.TimerTransformer) Predicate(java.util.function.Predicate) Attributes(com.newrelic.telemetry.Attributes) Set(java.util.Set) HistogramTransformer(com.codahale.metrics.newrelic.transformer.HistogramTransformer) TimeUnit(java.util.concurrent.TimeUnit) MetricAttribute(com.codahale.metrics.MetricAttribute) CounterTransformer(com.codahale.metrics.newrelic.transformer.CounterTransformer) MeterTransformer(com.codahale.metrics.newrelic.transformer.MeterTransformer) MetricNameCustomizer(com.codahale.metrics.newrelic.transformer.customizer.MetricNameCustomizer) MetricBatchSender(com.newrelic.telemetry.metrics.MetricBatchSender) MetricFilter(com.codahale.metrics.MetricFilter) GaugeTransformer(com.codahale.metrics.newrelic.transformer.GaugeTransformer) Collections(java.util.Collections) HistogramTransformer(com.codahale.metrics.newrelic.transformer.HistogramTransformer) TimerTransformer(com.codahale.metrics.newrelic.transformer.TimerTransformer) MeterTransformer(com.codahale.metrics.newrelic.transformer.MeterTransformer) MetricAttribute(com.codahale.metrics.MetricAttribute) TelemetryClient(com.newrelic.telemetry.TelemetryClient) CounterTransformer(com.codahale.metrics.newrelic.transformer.CounterTransformer) TimeTracker(com.codahale.metrics.newrelic.util.TimeTracker) GaugeTransformer(com.codahale.metrics.newrelic.transformer.GaugeTransformer)

Aggregations

Clock (com.codahale.metrics.Clock)1 MetricAttribute (com.codahale.metrics.MetricAttribute)1 MetricFilter (com.codahale.metrics.MetricFilter)1 MetricRegistry (com.codahale.metrics.MetricRegistry)1 CounterTransformer (com.codahale.metrics.newrelic.transformer.CounterTransformer)1 GaugeTransformer (com.codahale.metrics.newrelic.transformer.GaugeTransformer)1 HistogramTransformer (com.codahale.metrics.newrelic.transformer.HistogramTransformer)1 MeterTransformer (com.codahale.metrics.newrelic.transformer.MeterTransformer)1 TimerTransformer (com.codahale.metrics.newrelic.transformer.TimerTransformer)1 MetricAttributesCustomizer (com.codahale.metrics.newrelic.transformer.customizer.MetricAttributesCustomizer)1 MetricNameCustomizer (com.codahale.metrics.newrelic.transformer.customizer.MetricNameCustomizer)1 TimeTracker (com.codahale.metrics.newrelic.util.TimeTracker)1 Attributes (com.newrelic.telemetry.Attributes)1 TelemetryClient (com.newrelic.telemetry.TelemetryClient)1 MetricBatchSender (com.newrelic.telemetry.metrics.MetricBatchSender)1 Collections (java.util.Collections)1 Set (java.util.Set)1 TimeUnit (java.util.concurrent.TimeUnit)1 Predicate (java.util.function.Predicate)1