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

com.eg.agent.android.measurement.producer.NetworkMeasurementProducer Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
package com.eg.agent.android.measurement.producer;

/*import com.newrelic.agent.android.measurement.MeasurementType;
import com.newrelic.agent.android.measurement.http.HttpTransactionMeasurement;
import com.newrelic.agent.android.util.Util;*/

import com.eg.agent.android.measurement.MeasurementType;
import com.eg.agent.android.measurement.http.HttpTransactionMeasurement;
import com.eg.agent.android.util.Util;

public class NetworkMeasurementProducer extends BaseMeasurementProducer {
    public NetworkMeasurementProducer() {
        super(MeasurementType.Network);
    }

    public void produceMeasurement(String urlString, String httpMethod, int statusCode, int errorCode, long startTime, double totalTime, long bytesSent, long bytesReceived, String appData) {
        String url = Util.sanitizeUrl(urlString);
        if (url != null) {
            produceMeasurement(new HttpTransactionMeasurement(url, httpMethod, statusCode, errorCode, startTime, totalTime, bytesSent, bytesReceived, appData));
        }
    }

    public void produceMeasurement(HttpTransactionMeasurement transactionMeasurement) {
        String url = Util.sanitizeUrl(transactionMeasurement.getUrl());
        if (url != null) {
            transactionMeasurement.setUrl(url);
            super.produceMeasurement(transactionMeasurement);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy