Search in sources :

Example 1 with TelemetryFeatures

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;
}
Also used : TelemetryFeatures(com.adobe.target.delivery.v1.model.TelemetryFeatures)

Example 2 with 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());
}
Also used : TelemetryFeatures(com.adobe.target.delivery.v1.model.TelemetryFeatures) ExecutionMode(com.adobe.target.delivery.v1.model.ExecutionMode) TelemetryEntry(com.adobe.target.delivery.v1.model.TelemetryEntry)

Aggregations

TelemetryFeatures (com.adobe.target.delivery.v1.model.TelemetryFeatures)2 ExecutionMode (com.adobe.target.delivery.v1.model.ExecutionMode)1 TelemetryEntry (com.adobe.target.delivery.v1.model.TelemetryEntry)1