Skip to content

Commit 1c85511

Browse files
Add names to app launch vitals
1 parent 2fd5bc6 commit 1c85511

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumVitalAppLaunchEventHelper.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ internal class RumVitalAppLaunchEventHelper(
144144
ddtags = buildDDTagsString(datadogContext),
145145
vital = RumVitalAppLaunchEvent.Vital(
146146
id = UUID.randomUUID().toString(),
147-
name = null,
147+
name = appLaunchMetric.vitalName(),
148148
description = null,
149149
appLaunchMetric = appLaunchMetric,
150150
duration = durationNs,
@@ -155,3 +155,10 @@ internal class RumVitalAppLaunchEventHelper(
155155
)
156156
}
157157
}
158+
159+
private fun RumVitalAppLaunchEvent.AppLaunchMetric.vitalName(): String {
160+
return when (this) {
161+
RumVitalAppLaunchEvent.AppLaunchMetric.TTID -> "time_to_initial_display"
162+
RumVitalAppLaunchEvent.AppLaunchMetric.TTFD -> "time_to_full_display"
163+
}
164+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ internal class RumSessionScopeStartupManagerTest {
693693
val vital = value.vital
694694

695695
assertThat(vital).apply {
696-
hasName(null)
696+
hasName("time_to_initial_display")
697697
hasDescription(null)
698698
hasAppLaunchMetric(RumVitalAppLaunchEvent.AppLaunchMetric.TTID)
699699
hasDuration(info.durationNs)
@@ -745,7 +745,7 @@ internal class RumSessionScopeStartupManagerTest {
745745
val vital = value.vital
746746

747747
assertThat(vital).apply {
748-
hasName(null)
748+
hasName("time_to_full_display")
749749
hasDescription(null)
750750
hasAppLaunchMetric(RumVitalAppLaunchEvent.AppLaunchMetric.TTFD)
751751
hasDuration(durationNs)

0 commit comments

Comments
 (0)