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;
}
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);
}
Aggregations