Search in sources :

Example 11 with TelemetryEntry

use of com.adobe.target.delivery.v1.model.TelemetryEntry in project target-java-sdk by adobe.

the class TelemetryService method addTelemetry.

public void addTelemetry(TargetDeliveryRequest deliveryRequest, TimingTool timer, TargetDeliveryResponse targetDeliveryResponse) {
    TelemetryEntry telemetryEntry = createTelemetryEntry(deliveryRequest, targetDeliveryResponse, timer.timeEnd(TIMING_EXECUTE_REQUEST));
    if (telemetryEntry == null) {
        return;
    }
    storedTelemetries.add(telemetryEntry);
}
Also used : TelemetryEntry(com.adobe.target.delivery.v1.model.TelemetryEntry)

Example 12 with TelemetryEntry

use of com.adobe.target.delivery.v1.model.TelemetryEntry 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

TelemetryEntry (com.adobe.target.delivery.v1.model.TelemetryEntry)12 Context (com.adobe.target.delivery.v1.model.Context)6 ExecuteRequest (com.adobe.target.delivery.v1.model.ExecuteRequest)6 TargetDeliveryRequest (com.adobe.target.edge.client.model.TargetDeliveryRequest)6 TargetTestDeliveryRequestUtils.getContext (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getContext)6 TargetTestDeliveryRequestUtils.getMboxExecuteRequest (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getMboxExecuteRequest)6 Test (org.junit.jupiter.api.Test)6 PrefetchRequest (com.adobe.target.delivery.v1.model.PrefetchRequest)5 DeliveryResponse (com.adobe.target.delivery.v1.model.DeliveryResponse)4 Property (com.adobe.target.delivery.v1.model.Property)4 Telemetry (com.adobe.target.delivery.v1.model.Telemetry)4 TargetDeliveryResponse (com.adobe.target.edge.client.model.TargetDeliveryResponse)4 TargetTestDeliveryRequestUtils.getNoContentDeliveryResponse (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getNoContentDeliveryResponse)4 TargetTestDeliveryRequestUtils.getTestDeliveryResponse (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getTestDeliveryResponse)4 TimingTool (com.adobe.target.edge.client.utils.TimingTool)4 MboxRequest (com.adobe.target.delivery.v1.model.MboxRequest)2 ExecutionMode (com.adobe.target.delivery.v1.model.ExecutionMode)1 TelemetryFeatures (com.adobe.target.delivery.v1.model.TelemetryFeatures)1 TelemetryRequest (com.adobe.target.delivery.v1.model.TelemetryRequest)1 ArrayList (java.util.ArrayList)1