mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Adjust metrics to the new specifications (#5937)
* Add `AnalyticsTransactions` with a set of `TransactionDefinition` items matching those in the user story * Use that for `AnalyticsLongRunningTransactions`, make sure we send the right fields (name, operation, description) * Add `AnalyticsSendMessageWatcher` to track how long it takes for an event to be sent and for us to get a call back for that from sync * Add `Noop` implementation for enterprise
This commit is contained in:
committed by
GitHub
parent
a9e095ddf9
commit
06c4b9488b
+2
-2
@@ -112,8 +112,8 @@ class SentryAnalyticsProvider(
|
||||
Sentry.captureException(throwable)
|
||||
}
|
||||
|
||||
override fun startTransaction(name: String, operation: String?): AnalyticsTransaction? {
|
||||
return SentryAnalyticsTransaction(name, operation)
|
||||
override fun startTransaction(name: String, operation: String?, description: String?): AnalyticsTransaction? {
|
||||
return SentryAnalyticsTransaction(name, operation, description)
|
||||
}
|
||||
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
||||
|
||||
+4
-2
@@ -14,7 +14,9 @@ import io.sentry.Sentry
|
||||
import timber.log.Timber
|
||||
|
||||
class SentryAnalyticsTransaction private constructor(span: ISpan) : AnalyticsTransaction {
|
||||
constructor(name: String, operation: String?) : this(Sentry.startTransaction(name, operation.orEmpty()))
|
||||
constructor(name: String, operation: String?, description: String? = null) : this(
|
||||
Sentry.startTransaction(name, operation.orEmpty()).also { it.description = description }
|
||||
)
|
||||
private val inner = span
|
||||
|
||||
override fun startChild(operation: String, description: String?): AnalyticsTransaction = SentryAnalyticsTransaction(
|
||||
@@ -30,7 +32,7 @@ class SentryAnalyticsTransaction private constructor(span: ISpan) : AnalyticsTra
|
||||
}
|
||||
override fun finish() {
|
||||
val name = if (inner is ITransaction) inner.name else inner.operation
|
||||
Timber.d("Finishing transaction: $name")
|
||||
Timber.d("Finishing transaction: '$name'")
|
||||
inner.finish()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user