All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eg.agent.android.measurement.consumer.CustomMetricConsumer Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
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