Skip to content

Commit 89aff47

Browse files
authored
Mobile Session Replay, SDK Update, Disable Metrics (#97)
1 parent a9897f9 commit 89aff47

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

EmpowerPlant.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmpowerPlant/AppDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3838
options.attachViewHierarchy = true
3939
options.enableSwizzling = enableSwizzling
4040
options.enablePerformanceV2 = true
41-
options.enableMetrics = true
41+
// options.enableMetrics = true
42+
43+
// Enable Mobile Session Replay
44+
options.experimental.sessionReplay.onErrorSampleRate = 1.0
45+
options.experimental.sessionReplay.sessionSampleRate = 1.0
4246
}
4347
SentrySDK.configureScope{ scope in
4448
scope.setTag(value: ["corporate", "enterprise", "self-serve"].randomElement() ?? "unknown", key: "customer.type")

EmpowerPlant/CartViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ class CartViewController: UIViewController, UITableViewDelegate, UITableViewData
9898
if let httpResponse = response as? HTTPURLResponse {
9999
if (httpResponse.statusCode) == 500 {
100100
print("> 500 response")
101-
SentrySDK.metrics.increment(key: "checkout.error")
101+
//SentrySDK.metrics.increment(key: "checkout.error")
102102
let err = PurchaseError.insufficientInventory
103103
SentrySDK.capture(error: err) //Empowerplant Flagship Error
104104
} else {
105-
SentrySDK.metrics.increment(key: "checkout.success")
105+
//SentrySDK.metrics.increment(key: "checkout.success")
106106
}
107107
}
108108

EmpowerPlant/EmpowerPlantViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ class EmpowerPlantViewController: UIViewController {
323323
let task = URLSession.shared.dataTask(with: url) { data, response, error in
324324
let endTime = Date()
325325
let duration = endTime.timeIntervalSince(startTime)
326-
SentrySDK.metrics.distribution(
326+
/*SentrySDK.metrics.distribution(
327327
key: "products_request.duration",
328328
value: duration,
329329
unit: MeasurementUnitDuration.millisecond,
330330
tags: ["endpoint": urlStr]
331-
)
331+
)*/
332332

333333
if let data = data {
334334
if let productsResponse = try? JSONDecoder().decode([ProductMap].self, from: data) {
@@ -370,7 +370,7 @@ class EmpowerPlantViewController: UIViewController {
370370

371371
@objc
372372
func goToCart() {
373-
SentrySDK.metrics.increment(key: "checkout.click")
373+
//SentrySDK.metrics.increment(key: "checkout.click")
374374
self.performSegue(withIdentifier: "goToCart", sender: self)
375375
}
376376

0 commit comments

Comments
 (0)