Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apple): Add custom performance metrics #5629

Merged
merged 6 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
If configured, the Android SDK automatically collects the following performance metrics:

* Cold and warm app start time - learn more in <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#app-start-instrumentation">App Start Instrumentation</PlatformLink>.
* Frozen and slow frame rendering - learn more in <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames">Slow and Frozen Frames</PlatformLink>.
* <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#app-start-instrumentation">Cold and warm app start time</PlatformLink>.
* <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames">Slow and frozen frame rendering</PlatformLink>.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
If configured, the Cocoa SDK automatically collects the following performance metrics:

* <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#app-start-tracking">Cold and warm app start time</PlatformLink>
* <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames">Slow and frozen frame rendering</PlatformLink>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Adding custom metrics is supported in Sentry's Cocoa SDK, version `7.28.0` and above.

```swift {tabTitle: Swift}
import Sentry

let span = SentrySDK.span;

// Record amount of memory used
span?.setMeasurement(name: "memory_used", value: 64, unit: MeasurementUnitInformation.megabyte);

// Record time it took to load user profile
span?.setMeasurement(name: "user_profile_loading_time", value: 1.3, unit: MeasurementUnitDuration.second);

// Record number of times the screen was loaded
span?.setMeasurement(name: "screen_load_count", value: 4);
```

```objc {tabTitle:Objective-C}
@import Sentry;

id<SentrySpan> span = SentrySDK.span;
if (span != nil) {
// Record amount of memory used
[span setMeasurement:@"memory_used" value:@64 unit:SentryMeasurementUnitInformation.megabyte];

// Record time it took to load user profile
[span setMeasurement:@"user_profile_loading_time" value:@1.3 unit:SentryMeasurementUnitDuration.second];

// Record number of times the screen was loaded
[span setMeasurement:@"screen_load_count" value:@4];
}
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Adding custom metrics is supported in Sentry's Java SDK version `6.5.0` and above.
Adding custom metrics is supported in Sentry's Java SDK, version `6.5.0` and above.

```java {tabTitle:Java}
import io.sentry.ISpan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ supported:
- java
- java.spring-boot
- android
- apple
notSupported:
- javascript.cordova
- javascript.electron
- dotnet
- go
- ruby
- apple
- unity
- rust
- native
Expand All @@ -31,7 +31,7 @@ description: "Learn how to attach performance metrics to your transactions."

Sentry's SDKs support sending performance metrics data to Sentry. These are numeric values attached to transactions that are aggregated and displayed in Sentry.

<PlatformSection supported={["javascript", "android"]} notSupported={["react-native"]}>
<PlatformSection supported={["javascript", "android", "apple"]} notSupported={["react-native"]}>

<PlatformContent includePath="performance/automatic-performance-metrics" />

Expand Down