Skip to content

Commit faae92a

Browse files
authored
Merge pull request #2690 from DataDog/xgouchet/RUM-4247/set_max_age_to_24h
RUM-4247 Allow 24h batch backlog for RUM
2 parents 7f6ef9e + a87b5bc commit faae92a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/RumFeature.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ internal class RumFeature(
263263
)
264264
}
265265

266-
override val storageConfiguration: FeatureStorageConfiguration =
267-
FeatureStorageConfiguration.DEFAULT
266+
override val storageConfiguration: FeatureStorageConfiguration = FeatureStorageConfiguration.DEFAULT.copy(
267+
oldBatchThreshold = RUM_TTL_24H
268+
)
268269

269270
override fun onStop() {
270271
sdkCore.removeEventReceiver(name)
@@ -639,6 +640,7 @@ internal class RumFeature(
639640
internal const val TELEMETRY_SESSION_REPLAY_SKIP_FRAME = "sr_skipped_frame"
640641
internal const val FLUSH_AND_STOP_MONITOR_MESSAGE_TYPE = "flush_and_stop_monitor"
641642

643+
internal val RUM_TTL_24H = TimeUnit.HOURS.toMillis(24)
642644
internal const val ALL_IN_SAMPLE_RATE: Float = 100f
643645
internal const val DEFAULT_SAMPLE_RATE: Float = 100f
644646
internal const val DEFAULT_TELEMETRY_SAMPLE_RATE: Float = 20f

features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/internal/RumFeatureTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ internal class RumFeatureTest {
164164
.isInstanceOf(RumDataWriter::class.java)
165165
}
166166

167+
@Test
168+
fun `M allow 24h storage W init()`() {
169+
// When
170+
val config = testedFeature.storageConfiguration
171+
172+
// Then
173+
assertThat(config.oldBatchThreshold).isEqualTo(24L * 60L * 60L * 1000L)
174+
}
175+
167176
@Test
168177
fun `M store sample rate W initialize()`() {
169178
// When

0 commit comments

Comments
 (0)