From 9067467d2f280933e43aadb67fd46163f51ee40a Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Thu, 8 Aug 2024 10:45:22 +0200 Subject: [PATCH] test: Remove metrics API from the iOS-Swift sample (#4249) We plan on deprecating the existing metrics API. Therefore, we can already remove the usages in the iOS-Swift sample app to minimize side effects for UI tests. --- Samples/iOS-Swift/iOS-Swift/AppDelegate.swift | 7 ------- Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift | 6 ------ 2 files changed, 13 deletions(-) diff --git a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift index cc63313fd29..76e21d8eaca 100644 --- a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift +++ b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift @@ -155,8 +155,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return scope } }) - - SentrySDK.metrics.increment(key: "app.start", value: 1.0, tags: ["view": "app-delegate"]) } //swiftlint:enable function_body_length cyclomatic_complexity @@ -173,11 +171,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { AppDelegate.startSentry() } - randomDistributionTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { _ in - let random = Double.random(in: 0..<1_000) - SentrySDK.metrics.distribution(key: "random.distribution", value: random) - } - if #available(iOS 15.0, *) { metricKit.receiveReports() } diff --git a/Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift b/Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift index 87ec76487aa..6f31c018e34 100644 --- a/Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift +++ b/Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift @@ -11,12 +11,6 @@ class ErrorsViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) SentrySDK.reportFullyDisplayed() - - SentrySDK.metrics.increment(key: "load.errors.view.controller") - - SentrySDK.metrics.timing(key: "timing.some.delayed") { - Thread.sleep(forTimeInterval: 0.01) - } } @IBAction func useAfterFree(_ sender: UIButton) {