File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
docs/platforms/java/common/profiling
platform-includes/profiling/automatic-instrumentation-setup Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ Continuous profiling is available starting in SDK version `8.23.0` for macOS and
2121In addition to your typical Sentry dependencies, you will need to add ` sentry-async-profiler ` as a dependency:
2222
2323``` groovy {tabTitle:Gradle}
24- implementation 'io.sentry:sentry-async-profiler:{{@inject packages.version('sentry.java.sentry-async-profiler', '8.0 .0') }}'
24+ implementation 'io.sentry:sentry-async-profiler:{{@inject packages.version('sentry.java.sentry-async-profiler', '8.23 .0') }}'
2525```
2626``` xml {tabTitle:Maven}
2727<dependency >
2828 <groupId >io.sentry</groupId >
2929 <artifactId >sentry-async-profiler</artifactId >
30- <version >{{@inject packages.version('sentry.java.sentry-async-profiler', '8.0 .0') }}</version >
30+ <version >{{@inject packages.version('sentry.java.sentry-async-profiler', '8.23 .0') }}</version >
3131</dependency >
3232```
3333
Original file line number Diff line number Diff line change @@ -31,4 +31,31 @@ sentry.profile-lifecycle=MANUAL
3131sentry:
3232 profile-session-sample-rate: 1.0
3333 profile-lifecycle: MANUAL
34+ ` ` `
35+
36+ Then use the `startProfiler` and `stopProfiler` methods to start and stop profiling respectively.
37+
38+
39+ ` ` ` java
40+ import io.sentry.Sentry;
41+
42+ // Start profiling
43+ Sentry.startProfiler();
44+
45+ // run some code here
46+
47+ // Stop profiling
48+ Sentry.stopProfiler();
49+ ` ` `
50+
51+ ` ` ` kotlin
52+ import io.sentry.Sentry
53+
54+ // Start profiling
55+ Sentry.startProfiler()
56+
57+ // run some code here
58+
59+ // Stop profiling
60+ Sentry.stopProfiler()
3461` ` `
You can’t perform that action at this time.
0 commit comments