-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apple): Add custom performance metrics (#5629)
Co-authored-by: lizokm <lizka920@gmail.com>
- Loading branch information
1 parent
8819193
commit 95c4100
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/platform-includes/performance/automatic-performance-metrics/android.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>. |
4 changes: 4 additions & 0 deletions
4
src/platform-includes/performance/automatic-performance-metrics/apple.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
32 changes: 32 additions & 0 deletions
32
src/platform-includes/performance/custom-performance-metrics/apple.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | ||
} | ||
``` |
2 changes: 1 addition & 1 deletion
2
src/platform-includes/performance/custom-performance-metrics/java.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95c4100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sentry-docs – ./
docs.sentry.io
sentry-docs.sentry.dev
sentry-docs-git-master.sentry.dev