Search in sources :

Example 1 with Latencies

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Latencies in project carbon-apimgt by wso2.

the class SynapseAnalyticsDataProvider method getLatencies.

@Override
public Latencies getLatencies() {
    long backendLatency = getBackendLatency();
    long responseLatency = getResponseLatency();
    long requestMediationLatency = getRequestMediationLatency();
    long responseMediationLatency = getResponseMediationLatency();
    Latencies latencies = new Latencies();
    latencies.setResponseLatency(responseLatency);
    latencies.setBackendLatency(backendLatency);
    latencies.setRequestMediationLatency(requestMediationLatency);
    latencies.setResponseMediationLatency(responseMediationLatency);
    return latencies;
}
Also used : Latencies(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Latencies)

Example 2 with Latencies

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Latencies in project carbon-apimgt by wso2.

the class SuccessRequestDataCollector method collectData.

public void collectData() throws AnalyticsException {
    log.debug("Handling success analytics types");
    long requestInTime = provider.getRequestTime();
    String offsetDateTime = getTimeInISO(requestInTime);
    Event event = new Event();
    API api = provider.getApi();
    Operation operation = provider.getOperation();
    Target target = provider.getTarget();
    Application application;
    if (provider.isAnonymous()) {
        application = getAnonymousApp();
    } else {
        application = provider.getApplication();
    }
    Latencies latencies = provider.getLatencies();
    MetaInfo metaInfo = provider.getMetaInfo();
    String userAgent = provider.getUserAgentHeader();
    String userIp = provider.getEndUserIP();
    if (userIp == null) {
        userIp = Constants.UNKNOWN_VALUE;
    }
    event.setApi(api);
    event.setOperation(operation);
    event.setTarget(target);
    event.setApplication(application);
    event.setLatencies(latencies);
    event.setProxyResponseCode(provider.getProxyResponseCode());
    event.setRequestTimestamp(offsetDateTime);
    event.setMetaInfo(metaInfo);
    event.setUserAgentHeader(userAgent);
    event.setUserIp(userIp);
    this.processor.publish(event);
}
Also used : Target(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Target) Latencies(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Latencies) MetaInfo(org.wso2.carbon.apimgt.common.analytics.publishers.dto.MetaInfo) Event(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Event) API(org.wso2.carbon.apimgt.common.analytics.publishers.dto.API) Operation(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation) Application(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Application)

Aggregations

Latencies (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Latencies)2 API (org.wso2.carbon.apimgt.common.analytics.publishers.dto.API)1 Application (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Application)1 Event (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Event)1 MetaInfo (org.wso2.carbon.apimgt.common.analytics.publishers.dto.MetaInfo)1 Operation (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation)1 Target (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Target)1