Add extra analytics for notification performance (#6237)
* Add extra analytics for notification performance Add technical spans to track how long a notification fetching work request takes to run, then how long it takes to actually fetch the events for the notifications * Remove `withContext(io)` for `FetchNotificationsWorker` The default `Dispatchers.Default` dispatcher used should be good enough and more performant * Add network check span
This commit is contained in:
committed by
GitHub
parent
28c1c078a0
commit
2f80b101c5
@@ -28,4 +28,6 @@ sealed class AnalyticsLongRunningTransaction(
|
||||
data object LoadJoinedRoomFlow : AnalyticsLongRunningTransaction("Load joined room UI", "ui.load")
|
||||
data object LoadMessagesUi : AnalyticsLongRunningTransaction("Load messages UI", "ui.load")
|
||||
data object DisplayFirstTimelineItems : AnalyticsLongRunningTransaction("Get and display first timeline items", null)
|
||||
data class PushToNotification(val eventId: String) : AnalyticsLongRunningTransaction(AnalyticsTransactions.pushToNotification)
|
||||
data class PushToWorkManager(val eventId: String) : AnalyticsLongRunningTransaction("Push to WorkManager")
|
||||
}
|
||||
|
||||
@@ -108,11 +108,12 @@ fun AnalyticsService.cancelLongRunningTransaction(
|
||||
fun AnalyticsService.finishLongRunningTransaction(
|
||||
longRunningTransaction: AnalyticsLongRunningTransaction,
|
||||
action: (AnalyticsTransaction) -> Unit = {},
|
||||
) {
|
||||
removeLongRunningTransaction(longRunningTransaction)?.let {
|
||||
): Boolean {
|
||||
return removeLongRunningTransaction(longRunningTransaction)?.let {
|
||||
action(it)
|
||||
it.finish()
|
||||
}
|
||||
true
|
||||
} ?: false
|
||||
}
|
||||
|
||||
inline fun <T> AnalyticsService.inBridgeSdkSpan(parentTraceId: String?, block: (AnalyticsSdkSpan) -> T): T {
|
||||
|
||||
@@ -40,5 +40,6 @@ dependencies {
|
||||
testImplementation(projects.services.analytics.test)
|
||||
testImplementation(projects.services.analyticsproviders.test)
|
||||
testImplementation(projects.services.appnavstate.test)
|
||||
testImplementation(projects.features.networkmonitor.test)
|
||||
testImplementation(projects.services.toolbox.test)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user