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

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

The newest version!
package com.eg.agent.android.measurement.producer;



import com.eg.agent.android.measurement.MetricsType;
import com.eg.agent.android.measurement.http.HttpTransactionMetrics;
import com.eg.agent.android.util.Utils;

public class NetworkMetricsProducer extends BaseMetricsProducer {
    public NetworkMetricsProducer() {
        super(MetricsType.Network);
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy