com.eg.agent.android.measurement.consumer.CustomMetricConsumer Maven / Gradle / Ivy
package com.eg.agent.android.measurement.consumer;
/*import com.newrelic.agent.android.measurement.CustomMetricMeasurement;
import com.newrelic.agent.android.measurement.Measurement;
import com.newrelic.agent.android.measurement.MeasurementType;
import com.newrelic.agent.android.metric.Metric;*/
import com.eg.agent.android.measurement.CustomMetricMeasurement;
import com.eg.agent.android.measurement.Measurement;
import com.eg.agent.android.measurement.MeasurementType;
import com.eg.agent.android.metric.Metric;
public class CustomMetricConsumer extends MetricMeasurementConsumer {
private static final String METRIC_PREFIX = "Custom/";
public CustomMetricConsumer() {
super(MeasurementType.Custom);
}
protected String formatMetricName(String name) {
return METRIC_PREFIX + name;
}
public void consumeMeasurement(Measurement measurement) {
Metric metric = ((CustomMetricMeasurement) measurement).getCustomMetric();
metric.setName(formatMetricName(metric.getName()));
addMetric(metric);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy