From 6c881f4939d10d4b9e6c4fefd680b95d744a93cc Mon Sep 17 00:00:00 2001 From: Marius Constantin Date: Thu, 9 Nov 2023 09:09:01 +0100 Subject: [PATCH] RUM-1985 Add batchProcessingLevel information into the config telemetry --- .../com/datadog/android/core/DatadogCore.kt | 4 +- .../data/upload/v2/DataUploadRunnableTest.kt | 7 +-- features/dd-sdk-android-rum/api/apiSurface | 2 +- .../api/dd-sdk-android-rum.api | 48 +++++++++++-------- .../json/telemetry/configuration-schema.json | 12 +++++ .../internal/TelemetryCoreConfiguration.kt | 10 ++-- .../internal/TelemetryEventHandler.kt | 4 +- .../android/rum/internal/RumFeatureTest.kt | 9 ++-- ...elemetryCoreConfigurationForgeryFactory.kt | 3 +- .../TelemetryConfigurationEventAssert.kt | 9 ++++ .../TelemetryCoreConfigurationTest.kt | 7 ++- .../internal/TelemetryEventHandlerTest.kt | 1 + 12 files changed, 77 insertions(+), 39 deletions(-) diff --git a/dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/DatadogCore.kt b/dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/DatadogCore.kt index 75c014a746..03588bb4d6 100644 --- a/dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/DatadogCore.kt +++ b/dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/DatadogCore.kt @@ -427,7 +427,9 @@ internal class DatadogCore( "batch_size" to configuration.coreConfig.batchSize.windowDurationMs, "batch_upload_frequency" to configuration.coreConfig.uploadFrequency.baseStepMs, "use_proxy" to (configuration.coreConfig.proxy != null), - "use_local_encryption" to (configuration.coreConfig.encryption != null) + "use_local_encryption" to (configuration.coreConfig.encryption != null), + "batch_processing_level" to + configuration.coreConfig.batchProcessingLevel.maxBatchesPerUploadJob ) rumFeature.sendEvent(coreConfigurationEvent) } diff --git a/dd-sdk-android-core/src/test/kotlin/com/datadog/android/core/internal/data/upload/v2/DataUploadRunnableTest.kt b/dd-sdk-android-core/src/test/kotlin/com/datadog/android/core/internal/data/upload/v2/DataUploadRunnableTest.kt index 43eb1f73cd..af06c19a32 100644 --- a/dd-sdk-android-core/src/test/kotlin/com/datadog/android/core/internal/data/upload/v2/DataUploadRunnableTest.kt +++ b/dd-sdk-android-core/src/test/kotlin/com/datadog/android/core/internal/data/upload/v2/DataUploadRunnableTest.kt @@ -670,10 +670,7 @@ internal class DataUploadRunnableTest { val captor = argumentCaptor() verify( mockThreadPoolExecutor, - times( - 5 * - fakeDataUploadConfiguration.maxBatchesPerUploadJob - ) + times(5 * expectedBatchesHandled) ) .schedule(same(testedRunnable), captor.capture(), eq(TimeUnit.MILLISECONDS)) captor.allValues.reduce { previous, next -> @@ -1038,7 +1035,7 @@ internal class DataUploadRunnableTest { } @Test - fun `𝕄 exhaust the available batches W run {maxBatchesPerJob higher availableBatches}`( + fun `𝕄 exhaust the available batches W run {maxBatchesPerJob higher or equal availableBatches}`( forge: Forge, @Forgery fakeConfiguration: DataUploadConfiguration ) { diff --git a/features/dd-sdk-android-rum/api/apiSurface b/features/dd-sdk-android-rum/api/apiSurface index 9b16b6482d..97f125ac49 100644 --- a/features/dd-sdk-android-rum/api/apiSurface +++ b/features/dd-sdk-android-rum/api/apiSurface @@ -1551,7 +1551,7 @@ data class com.datadog.android.telemetry.model.TelemetryConfigurationEvent fun fromJson(kotlin.String): Telemetry fun fromJsonObject(com.google.gson.JsonObject): Telemetry data class Configuration - constructor(kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.collections.List? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.collections.List? = null, kotlin.collections.List? = null, kotlin.Boolean? = null, ViewTrackingStrategy? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null) + constructor(kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.collections.List? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.collections.List? = null, kotlin.collections.List? = null, kotlin.Boolean? = null, ViewTrackingStrategy? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null) fun toJson(): com.google.gson.JsonElement companion object fun fromJson(kotlin.String): Configuration diff --git a/features/dd-sdk-android-rum/api/dd-sdk-android-rum.api b/features/dd-sdk-android-rum/api/dd-sdk-android-rum.api index ab7c7df157..9af17f6cfd 100644 --- a/features/dd-sdk-android-rum/api/dd-sdk-android-rum.api +++ b/features/dd-sdk-android-rum/api/dd-sdk-android-rum.api @@ -4723,8 +4723,8 @@ public final class com/datadog/android/telemetry/model/TelemetryConfigurationEve public final class com/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration { public static final field Companion Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration$Companion; public fun ()V - public fun (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - public synthetic fun (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/Long; public final fun component10 ()Ljava/lang/Boolean; public final fun component11 ()Ljava/lang/Boolean; @@ -4735,13 +4735,13 @@ public final class com/datadog/android/telemetry/model/TelemetryConfigurationEve public final fun component16 ()Ljava/lang/Boolean; public final fun component17 ()Ljava/lang/Boolean; public final fun component18 ()Ljava/lang/Boolean; - public final fun component19 ()Ljava/lang/String; + public final fun component19 ()Ljava/lang/Boolean; public final fun component2 ()Ljava/lang/Long; - public final fun component20 ()Ljava/lang/Boolean; + public final fun component20 ()Ljava/lang/String; public final fun component21 ()Ljava/lang/Boolean; - public final fun component22 ()Ljava/util/List; - public final fun component23 ()Ljava/lang/String; - public final fun component24 ()Ljava/lang/Boolean; + public final fun component22 ()Ljava/lang/Boolean; + public final fun component23 ()Ljava/util/List; + public final fun component24 ()Ljava/lang/String; public final fun component25 ()Ljava/lang/Boolean; public final fun component26 ()Ljava/lang/Boolean; public final fun component27 ()Ljava/lang/Boolean; @@ -4749,13 +4749,13 @@ public final class com/datadog/android/telemetry/model/TelemetryConfigurationEve public final fun component29 ()Ljava/lang/Boolean; public final fun component3 ()Ljava/lang/Long; public final fun component30 ()Ljava/lang/Boolean; - public final fun component31 ()Ljava/util/List; + public final fun component31 ()Ljava/lang/Boolean; public final fun component32 ()Ljava/util/List; - public final fun component33 ()Ljava/lang/Boolean; - public final fun component34 ()Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy; - public final fun component35 ()Ljava/lang/Boolean; - public final fun component36 ()Ljava/lang/Long; - public final fun component37 ()Ljava/lang/Boolean; + public final fun component33 ()Ljava/util/List; + public final fun component34 ()Ljava/lang/Boolean; + public final fun component35 ()Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy; + public final fun component36 ()Ljava/lang/Boolean; + public final fun component37 ()Ljava/lang/Long; public final fun component38 ()Ljava/lang/Boolean; public final fun component39 ()Ljava/lang/Boolean; public final fun component4 ()Ljava/lang/Long; @@ -4764,26 +4764,31 @@ public final class com/datadog/android/telemetry/model/TelemetryConfigurationEve public final fun component42 ()Ljava/lang/Boolean; public final fun component43 ()Ljava/lang/Boolean; public final fun component44 ()Ljava/lang/Boolean; - public final fun component45 ()Ljava/lang/String; - public final fun component46 ()Ljava/lang/Boolean; - public final fun component47 ()Ljava/lang/Long; + public final fun component45 ()Ljava/lang/Boolean; + public final fun component46 ()Ljava/lang/String; + public final fun component47 ()Ljava/lang/Boolean; public final fun component48 ()Ljava/lang/Long; - public final fun component49 ()Ljava/lang/String; + public final fun component49 ()Ljava/lang/Long; public final fun component5 ()Ljava/lang/Long; - public final fun component50 ()Ljava/lang/String; - public final fun component51 ()Ljava/lang/String; + public final fun component50 ()Ljava/lang/Long; + public final fun component51 ()Ljava/lang/Boolean; + public final fun component52 ()Ljava/lang/String; + public final fun component53 ()Ljava/lang/String; + public final fun component54 ()Ljava/lang/String; public final fun component6 ()Ljava/lang/Long; public final fun component7 ()Ljava/lang/Long; public final fun component8 ()Ljava/lang/Boolean; public final fun component9 ()Ljava/lang/Boolean; - public final fun copy (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; - public static synthetic fun copy$default (Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; + public final fun copy (Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; + public static synthetic fun copy$default (Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$ViewTrackingStrategy;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; public fun equals (Ljava/lang/Object;)Z public static final fun fromJson (Ljava/lang/String;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; public static final fun fromJsonObject (Lcom/google/gson/JsonObject;)Lcom/datadog/android/telemetry/model/TelemetryConfigurationEvent$Configuration; public final fun getActionNameAttribute ()Ljava/lang/String; public final fun getAllowFallbackToLocalStorage ()Ljava/lang/Boolean; public final fun getAllowUntrustedEvents ()Ljava/lang/Boolean; + public final fun getBackgroundTasksEnabled ()Ljava/lang/Boolean; + public final fun getBatchProcessingLevel ()Ljava/lang/Long; public final fun getBatchSize ()Ljava/lang/Long; public final fun getBatchUploadFrequency ()Ljava/lang/Long; public final fun getDartVersion ()Ljava/lang/String; @@ -4802,6 +4807,7 @@ public final class com/datadog/android/telemetry/model/TelemetryConfigurationEve public final fun getSessionSampleRate ()Ljava/lang/Long; public final fun getSilentMultipleInit ()Ljava/lang/Boolean; public final fun getStartSessionReplayRecordingManually ()Ljava/lang/Boolean; + public final fun getStoreContextsAcrossPages ()Ljava/lang/Boolean; public final fun getTelemetryConfigurationSampleRate ()Ljava/lang/Long; public final fun getTelemetrySampleRate ()Ljava/lang/Long; public final fun getTraceSampleRate ()Ljava/lang/Long; diff --git a/features/dd-sdk-android-rum/src/main/json/telemetry/configuration-schema.json b/features/dd-sdk-android-rum/src/main/json/telemetry/configuration-schema.json index 3eed584084..3b67a4799e 100644 --- a/features/dd-sdk-android-rum/src/main/json/telemetry/configuration-schema.json +++ b/features/dd-sdk-android-rum/src/main/json/telemetry/configuration-schema.json @@ -112,6 +112,10 @@ "type": "boolean", "description": "Whether it is allowed to use LocalStorage when cookies are not available" }, + "store_contexts_across_pages": { + "type": "boolean", + "description": "Whether contexts are stored in local storage" + }, "allow_untrusted_events": { "type": "boolean", "description": "Whether untrusted events are allowed" @@ -284,6 +288,14 @@ "type": "integer", "description": "The upload frequency of batches (in milliseconds)" }, + "batch_processing_level": { + "type": "integer", + "description": "Maximum number of batches processed sequencially without a delay" + }, + "background_tasks_enabled": { + "type": "boolean", + "description": "Whether UIApplication background tasks are enabled" + }, "react_version": { "type": "string", "description": "The version of React used in a ReactNative application", diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfiguration.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfiguration.kt index a352551d47..2cc5c94bf8 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfiguration.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfiguration.kt @@ -15,7 +15,9 @@ internal data class TelemetryCoreConfiguration( // uploadFrequency.baseStepMs val batchUploadFrequency: Long, val useProxy: Boolean, - val useLocalEncryption: Boolean + val useLocalEncryption: Boolean, + // batchProcessingLevel.maxBatchesPerUploadJob + val batchProcessingLevel: Long ) { companion object { fun fromEvent(event: Map<*, *>, internalLogger: InternalLogger): TelemetryCoreConfiguration? { @@ -24,10 +26,11 @@ internal data class TelemetryCoreConfiguration( val batchUploadFrequency = event["batch_upload_frequency"] as? Long val useProxy = event["use_proxy"] as? Boolean val useLocalEncryption = event["use_local_encryption"] as? Boolean + val batchProcessingLevel = event["batch_processing_level"] as? Long @Suppress("ComplexCondition") if (trackErrors == null || batchSize == null || batchUploadFrequency == null || - useProxy == null || useLocalEncryption == null + useProxy == null || useLocalEncryption == null || batchProcessingLevel == null ) { // TODO RUMM-3088 Do an intelligent reporting when message values are missing/have // wrong type, reporting the parameter name and what is exactly wrong @@ -48,7 +51,8 @@ internal data class TelemetryCoreConfiguration( batchSize = batchSize, batchUploadFrequency = batchUploadFrequency, useProxy = useProxy, - useLocalEncryption = useLocalEncryption + useLocalEncryption = useLocalEncryption, + batchProcessingLevel = batchProcessingLevel ) } } diff --git a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandler.kt b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandler.kt index e2c0688953..2602ef5433 100644 --- a/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandler.kt +++ b/features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandler.kt @@ -262,8 +262,8 @@ internal class TelemetryEventHandler( trackNetworkRequests = trackNetworkRequests, sessionReplaySampleRate = sessionReplaySampleRate, defaultPrivacyLevel = sessionReplayPrivacy, - startSessionReplayRecordingManually = startSessionReplayManually - + startSessionReplayRecordingManually = startSessionReplayManually, + batchProcessingLevel = coreConfiguration.batchProcessingLevel ) ) ) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/RumFeatureTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/RumFeatureTest.kt index 9aaae5b2fa..1c11c8da39 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/RumFeatureTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/RumFeatureTest.kt @@ -1213,7 +1213,8 @@ internal class RumFeatureTest { @BoolForgery useProxy: Boolean, @BoolForgery useLocalEncryption: Boolean, @LongForgery(min = 0L) batchSize: Long, - @LongForgery(min = 0L) batchUploadFrequency: Long + @LongForgery(min = 0L) batchUploadFrequency: Long, + @LongForgery(min = 0L) batchProcessingLevel: Long ) { // Given testedFeature.onInitialize(appContext.mockInstance) @@ -1223,7 +1224,8 @@ internal class RumFeatureTest { "batch_size" to batchSize, "batch_upload_frequency" to batchUploadFrequency, "use_proxy" to useProxy, - "use_local_encryption" to useLocalEncryption + "use_local_encryption" to useLocalEncryption, + "batch_processing_level" to batchProcessingLevel ) // When @@ -1237,7 +1239,8 @@ internal class RumFeatureTest { batchSize = batchSize, batchUploadFrequency = batchUploadFrequency, useProxy = useProxy, - useLocalEncryption = useLocalEncryption + useLocalEncryption = useLocalEncryption, + batchProcessingLevel = batchProcessingLevel ) ) diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/utils/forge/TelemetryCoreConfigurationForgeryFactory.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/utils/forge/TelemetryCoreConfigurationForgeryFactory.kt index 6663d519b9..5666185bf4 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/utils/forge/TelemetryCoreConfigurationForgeryFactory.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/utils/forge/TelemetryCoreConfigurationForgeryFactory.kt @@ -18,7 +18,8 @@ internal class TelemetryCoreConfigurationForgeryFactory : batchSize = forge.aPositiveLong(), batchUploadFrequency = forge.aPositiveLong(), useProxy = forge.aBool(), - useLocalEncryption = forge.aBool() + useLocalEncryption = forge.aBool(), + batchProcessingLevel = forge.aPositiveLong() ) } } diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/assertj/TelemetryConfigurationEventAssert.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/assertj/TelemetryConfigurationEventAssert.kt index 8aaabe851a..4661cce107 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/assertj/TelemetryConfigurationEventAssert.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/assertj/TelemetryConfigurationEventAssert.kt @@ -249,6 +249,15 @@ internal class TelemetryConfigurationEventAssert(actual: TelemetryConfigurationE .isEqualTo(expected) return this } + fun hasBatchProcessingLevel(expected: Long?): TelemetryConfigurationEventAssert { + assertThat(actual.telemetry.configuration.batchProcessingLevel) + .overridingErrorMessage( + "Expected event data to have telemetry.configuration.batchProcessingLevel $expected " + + "but was ${actual.telemetry.configuration.batchProcessingLevel}" + ) + .isEqualTo(expected) + return this + } // endregion diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfigurationTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfigurationTest.kt index 7de3134225..2006d62c57 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfigurationTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryCoreConfigurationTest.kt @@ -30,7 +30,8 @@ internal class TelemetryCoreConfigurationTest { @BoolForgery useProxy: Boolean, @BoolForgery useLocalEncryption: Boolean, @LongForgery(min = 0L) batchSize: Long, - @LongForgery(min = 0L) batchUploadFrequency: Long + @LongForgery(min = 0L) batchUploadFrequency: Long, + @LongForgery(min = 0L) batchProcessingLevel: Long ) { // Given val event = mapOf( @@ -39,7 +40,8 @@ internal class TelemetryCoreConfigurationTest { "batch_size" to batchSize, "batch_upload_frequency" to batchUploadFrequency, "use_proxy" to useProxy, - "use_local_encryption" to useLocalEncryption + "use_local_encryption" to useLocalEncryption, + "batch_processing_level" to batchProcessingLevel ) // When @@ -52,6 +54,7 @@ internal class TelemetryCoreConfigurationTest { assertThat(coreConfig.batchUploadFrequency).isEqualTo(batchUploadFrequency) assertThat(coreConfig.useProxy).isEqualTo(useProxy) assertThat(coreConfig.useLocalEncryption).isEqualTo(useLocalEncryption) + assertThat(coreConfig.batchProcessingLevel).isEqualTo(batchProcessingLevel) } @Test diff --git a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandlerTest.kt b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandlerTest.kt index ec2338887a..d41743241e 100644 --- a/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandlerTest.kt +++ b/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/internal/TelemetryEventHandlerTest.kt @@ -349,6 +349,7 @@ internal class TelemetryEventHandlerTest { .hasTrackErrors(fakeCoreConfiguration.trackErrors) .hasBatchSize(fakeCoreConfiguration.batchSize) .hasBatchUploadFrequency(fakeCoreConfiguration.batchUploadFrequency) + .hasBatchProcessingLevel(fakeCoreConfiguration.batchProcessingLevel) } }