use of com.adobe.target.delivery.v1.model.TelemetryFeatures in project target-java-sdk by adobe.
the class TelemetryService method buildTelemetryFeatures.
private TelemetryFeatures buildTelemetryFeatures(TargetDeliveryRequest targetDeliveryRequest) {
com.adobe.target.delivery.v1.model.DecisioningMethod decisioningMethod = com.adobe.target.delivery.v1.model.DecisioningMethod.valueOf(getDecisioningMethod(targetDeliveryRequest).name());
TelemetryFeatures telemetryFeatures = new TelemetryFeatures();
telemetryFeatures.setDecisioningMethod(decisioningMethod);
int countOfExecutedMbox = executeMboxCount(targetDeliveryRequest);
int countOfPrefetchedMbox = prefetchMboxCount(targetDeliveryRequest);
int countOfPrefetchedView = prefetchViewCount(targetDeliveryRequest);
boolean isItExecutePageLoad = isExecutePageLoad(targetDeliveryRequest);
boolean isItPrefetchedPageLoad = isPrefetchPageLoad(targetDeliveryRequest);
if (countOfExecutedMbox != 0) {
telemetryFeatures.setExecuteMboxCount(countOfExecutedMbox);
}
if (countOfPrefetchedMbox != 0) {
telemetryFeatures.setPrefetchMboxCount(countOfPrefetchedMbox);
}
if (countOfPrefetchedView != 0) {
telemetryFeatures.setPrefetchViewCount(countOfPrefetchedView);
}
if (isItExecutePageLoad) {
telemetryFeatures.setExecutePageLoad(true);
}
if (isItPrefetchedPageLoad) {
telemetryFeatures.setPrefetchPageLoad(true);
}
return telemetryFeatures;
}
use of com.adobe.target.delivery.v1.model.TelemetryFeatures in project target-java-sdk by adobe.
the class TelemetryService method createTelemetryEntry.
private TelemetryEntry createTelemetryEntry(TargetDeliveryRequest targetDeliveryRequest, TargetDeliveryResponse targetDeliveryResponse, double executionTime) {
if (!clientConfig.isTelemetryEnabled() || targetDeliveryResponse.getResponse() == null) {
return null;
}
TelemetryFeatures telemetryFeatures = buildTelemetryFeatures(targetDeliveryRequest);
ExecutionMode executionMode = getMode(targetDeliveryResponse);
return new TelemetryEntry().requestId(targetDeliveryResponse.getResponse().getRequestId()).telemetryServerToken(targetDeliveryResponse.getResponse().getTelemetryServerToken()).mode(executionMode).features(telemetryFeatures).execution(MathUtils.roundDouble(executionTime, DECIMAL_PLACES)).timestamp(System.currentTimeMillis());
}
Aggregations