mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Setup Sentry instrumentation on top of the existing Signposter (#2985)
* Move Sentry setup outside of the BugReportService * Setup Sentry SwiftUI tracing for the homeScreen and roomScreen roots * Setup Sentry instrumentation on top of the existing Signposter * Various tweaks
This commit is contained in:
@@ -1815,87 +1815,13 @@ class AudioSessionMock: AudioSessionProtocol {
|
||||
}
|
||||
}
|
||||
class BugReportServiceMock: BugReportServiceProtocol {
|
||||
var isRunning: Bool {
|
||||
get { return underlyingIsRunning }
|
||||
set(value) { underlyingIsRunning = value }
|
||||
}
|
||||
var underlyingIsRunning: Bool!
|
||||
var crashedLastRun: Bool {
|
||||
get { return underlyingCrashedLastRun }
|
||||
set(value) { underlyingCrashedLastRun = value }
|
||||
}
|
||||
var underlyingCrashedLastRun: Bool!
|
||||
var lastCrashEventID: String?
|
||||
|
||||
//MARK: - start
|
||||
|
||||
var startUnderlyingCallsCount = 0
|
||||
var startCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return startUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = startUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
startUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
startUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var startCalled: Bool {
|
||||
return startCallsCount > 0
|
||||
}
|
||||
var startClosure: (() -> Void)?
|
||||
|
||||
func start() {
|
||||
startCallsCount += 1
|
||||
startClosure?()
|
||||
}
|
||||
//MARK: - stop
|
||||
|
||||
var stopUnderlyingCallsCount = 0
|
||||
var stopCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return stopUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = stopUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
stopUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
stopUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var stopCalled: Bool {
|
||||
return stopCallsCount > 0
|
||||
}
|
||||
var stopClosure: (() -> Void)?
|
||||
|
||||
func stop() {
|
||||
stopCallsCount += 1
|
||||
stopClosure?()
|
||||
}
|
||||
//MARK: - submitBugReport
|
||||
|
||||
var submitBugReportProgressListenerUnderlyingCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user