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