mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Measure performance in Sentry
This commit is contained in:
@@ -338,6 +338,10 @@ extension Analytics: MXAnalyticsDelegate {
|
||||
capture(event: event)
|
||||
}
|
||||
|
||||
func startDurationTracking(forName name: String, operation: String) -> StopDurationTracking {
|
||||
return monitoringClient.startPerformanceTracking(name: name, operation: operation)
|
||||
}
|
||||
|
||||
func trackCallStarted(withVideo isVideo: Bool, numberOfParticipants: Int, incoming isIncoming: Bool) {
|
||||
let event = AnalyticsEvent.CallStarted(isVideo: isVideo, numParticipants: numberOfParticipants, placed: !isIncoming)
|
||||
capture(event: event)
|
||||
|
||||
@@ -34,6 +34,7 @@ struct SentryMonitoringClient {
|
||||
options.dsn = Self.sentryDSN
|
||||
|
||||
// Collecting only 10% of all events
|
||||
options.sampleRate = 0.1
|
||||
options.tracesSampleRate = 0.1
|
||||
|
||||
options.beforeSend = { event in
|
||||
@@ -66,4 +67,11 @@ struct SentryMonitoringClient {
|
||||
event.extra = details
|
||||
SentrySDK.capture(event: event)
|
||||
}
|
||||
|
||||
func startPerformanceTracking(name: String, operation: String) -> StopDurationTracking {
|
||||
let transaction = SentrySDK.startTransaction(name: name, operation: operation)
|
||||
return {
|
||||
transaction.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user