Skip to content

Commit c83e427

Browse files
authored
Changed continuous profiling names: (#4265)
Renamed Sentry.startProfileSession -> Sentry.startProfiler Sentry.stopProfileSession -> Sentry.stopProfiler
1 parent 84bf981 commit c83e427

27 files changed

+165
-165
lines changed

CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- This enables symbolication for stripped native code in ANRs
99
- Add Continuous Profiling Support ([#3710](https://github.com/getsentry/sentry-java/pull/3710))
1010

11-
To enable Continuous Profiling use the `Sentry.startProfileSession` and `Sentry.stopProfileSession` experimental APIs. Sampling rate can be set through `options.profileSessionSampleRate`, which defaults to null (disabled).
11+
To enable Continuous Profiling use the `Sentry.startProfiler` and `Sentry.stopProfiler` experimental APIs. Sampling rate can be set through `options.profileSessionSampleRate`, which defaults to null (disabled).
1212
Note: Both `options.profilesSampler` and `options.profilesSampleRate` must **not** be set to enable Continuous Profiling.
1313

1414
```java
@@ -19,15 +19,15 @@
1919

2020
// Currently under experimental options:
2121
options.getExperimental().setProfileSessionSampleRate(1.0);
22-
// In manual mode, you need to start and stop the profiler manually using Sentry.startProfileSession and Sentry.stopProfileSession
22+
// In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler
2323
// In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes
2424
options.getExperimental().setProfileLifecycle(ProfileLifecycle.MANUAL);
2525
}
2626
// Start profiling
27-
Sentry.startProfileSession();
27+
Sentry.startProfiler();
2828

2929
// After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped.
30-
Sentry.stopProfileSession();
30+
Sentry.stopProfiler();
3131
```
3232
```kotlin
3333
import io.sentry.ProfileLifecycle
@@ -37,15 +37,15 @@
3737

3838
// Currently under experimental options:
3939
options.experimental.profileSessionSampleRate = 1.0
40-
// In manual mode, you need to start and stop the profiler manually using Sentry.startProfileSession and Sentry.stopProfileSession
40+
// In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler
4141
// In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes
4242
options.experimental.profileLifecycle = ProfileLifecycle.MANUAL
4343
}
4444
// Start profiling
45-
Sentry.startProfileSession()
45+
Sentry.startProfiler()
4646

4747
// After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped.
48-
Sentry.stopProfileSession()
48+
Sentry.stopProfiler()
4949
```
5050

5151
To learn more visit [Sentry's Continuous Profiling](https://docs.sentry.io/product/explore/profiling/transaction-vs-continuous-profiling/#continuous-profiling-mode) documentation page.

sentry-android-core/api/sentry-android-core.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public class io/sentry/android/core/AndroidContinuousProfiler : io/sentry/IConti
4848
public fun isRunning ()Z
4949
public fun onRateLimitChanged (Lio/sentry/transport/RateLimiter;)V
5050
public fun reevaluateSampling ()V
51-
public fun startProfileSession (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
52-
public fun stopProfileSession (Lio/sentry/ProfileLifecycle;)V
51+
public fun startProfiler (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
52+
public fun stopProfiler (Lio/sentry/ProfileLifecycle;)V
5353
}
5454

5555
public final class io/sentry/android/core/AndroidCpuCollector : io/sentry/IPerformanceSnapshotCollector {

sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void init() {
106106
}
107107

108108
@Override
109-
public synchronized void startProfileSession(
109+
public synchronized void startProfiler(
110110
final @NotNull ProfileLifecycle profileLifecycle,
111111
final @NotNull TracesSampler tracesSampler) {
112112
if (shouldSample) {
@@ -217,7 +217,7 @@ private synchronized void start() {
217217
}
218218

219219
@Override
220-
public synchronized void stopProfileSession(final @NotNull ProfileLifecycle profileLifecycle) {
220+
public synchronized void stopProfiler(final @NotNull ProfileLifecycle profileLifecycle) {
221221
switch (profileLifecycle) {
222222
case TRACE:
223223
rootSpanCounter--;

sentry-android-core/src/main/java/io/sentry/android/core/SentryPerformanceProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void createAndStartContinuousProfiler(
178178
sentryOptions
179179
.getExperimental()
180180
.setProfileSessionSampleRate(profilingOptions.isContinuousProfileSampled() ? 1.0 : 0.0);
181-
appStartContinuousProfiler.startProfileSession(
181+
appStartContinuousProfiler.startProfiler(
182182
profilingOptions.getProfileLifecycle(), new TracesSampler(sentryOptions));
183183
}
184184

sentry-android-core/src/test/java/io/sentry/android/core/AndroidContinuousProfilerTest.kt

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class MyApplication extends Application {
99

1010
@Override
1111
public void onCreate() {
12-
Sentry.startProfileSession();
12+
Sentry.startProfiler();
1313
strictMode();
1414
super.onCreate();
1515

sentry/api/sentry.api

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,10 @@ public final class io/sentry/HubAdapter : io/sentry/IHub {
652652
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
653653
public fun setTransaction (Ljava/lang/String;)V
654654
public fun setUser (Lio/sentry/protocol/User;)V
655-
public fun startProfileSession ()V
655+
public fun startProfiler ()V
656656
public fun startSession ()V
657657
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
658-
public fun stopProfileSession ()V
658+
public fun stopProfiler ()V
659659
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
660660
public fun withScope (Lio/sentry/ScopeCallback;)V
661661
}
@@ -719,10 +719,10 @@ public final class io/sentry/HubScopesWrapper : io/sentry/IHub {
719719
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
720720
public fun setTransaction (Ljava/lang/String;)V
721721
public fun setUser (Lio/sentry/protocol/User;)V
722-
public fun startProfileSession ()V
722+
public fun startProfiler ()V
723723
public fun startSession ()V
724724
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
725-
public fun stopProfileSession ()V
725+
public fun stopProfiler ()V
726726
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
727727
public fun withScope (Lio/sentry/ScopeCallback;)V
728728
}
@@ -752,8 +752,8 @@ public abstract interface class io/sentry/IContinuousProfiler {
752752
public abstract fun getProfilerId ()Lio/sentry/protocol/SentryId;
753753
public abstract fun isRunning ()Z
754754
public abstract fun reevaluateSampling ()V
755-
public abstract fun startProfileSession (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
756-
public abstract fun stopProfileSession (Lio/sentry/ProfileLifecycle;)V
755+
public abstract fun startProfiler (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
756+
public abstract fun stopProfiler (Lio/sentry/ProfileLifecycle;)V
757757
}
758758

759759
public abstract interface class io/sentry/IEnvelopeReader {
@@ -958,13 +958,13 @@ public abstract interface class io/sentry/IScopes {
958958
public abstract fun setTag (Ljava/lang/String;Ljava/lang/String;)V
959959
public abstract fun setTransaction (Ljava/lang/String;)V
960960
public abstract fun setUser (Lio/sentry/protocol/User;)V
961-
public abstract fun startProfileSession ()V
961+
public abstract fun startProfiler ()V
962962
public abstract fun startSession ()V
963963
public fun startTransaction (Lio/sentry/TransactionContext;)Lio/sentry/ITransaction;
964964
public abstract fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
965965
public fun startTransaction (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ITransaction;
966966
public fun startTransaction (Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
967-
public abstract fun stopProfileSession ()V
967+
public abstract fun stopProfiler ()V
968968
public abstract fun withIsolationScope (Lio/sentry/ScopeCallback;)V
969969
public abstract fun withScope (Lio/sentry/ScopeCallback;)V
970970
}
@@ -1436,8 +1436,8 @@ public final class io/sentry/NoOpContinuousProfiler : io/sentry/IContinuousProfi
14361436
public fun getProfilerId ()Lio/sentry/protocol/SentryId;
14371437
public fun isRunning ()Z
14381438
public fun reevaluateSampling ()V
1439-
public fun startProfileSession (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
1440-
public fun stopProfileSession (Lio/sentry/ProfileLifecycle;)V
1439+
public fun startProfiler (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
1440+
public fun stopProfiler (Lio/sentry/ProfileLifecycle;)V
14411441
}
14421442

14431443
public final class io/sentry/NoOpEnvelopeReader : io/sentry/IEnvelopeReader {
@@ -1505,10 +1505,10 @@ public final class io/sentry/NoOpHub : io/sentry/IHub {
15051505
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
15061506
public fun setTransaction (Ljava/lang/String;)V
15071507
public fun setUser (Lio/sentry/protocol/User;)V
1508-
public fun startProfileSession ()V
1508+
public fun startProfiler ()V
15091509
public fun startSession ()V
15101510
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
1511-
public fun stopProfileSession ()V
1511+
public fun stopProfiler ()V
15121512
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
15131513
public fun withScope (Lio/sentry/ScopeCallback;)V
15141514
}
@@ -1667,10 +1667,10 @@ public final class io/sentry/NoOpScopes : io/sentry/IScopes {
16671667
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
16681668
public fun setTransaction (Ljava/lang/String;)V
16691669
public fun setUser (Lio/sentry/protocol/User;)V
1670-
public fun startProfileSession ()V
1670+
public fun startProfiler ()V
16711671
public fun startSession ()V
16721672
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
1673-
public fun stopProfileSession ()V
1673+
public fun stopProfiler ()V
16741674
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
16751675
public fun withScope (Lio/sentry/ScopeCallback;)V
16761676
}
@@ -2344,10 +2344,10 @@ public final class io/sentry/Scopes : io/sentry/IScopes {
23442344
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
23452345
public fun setTransaction (Ljava/lang/String;)V
23462346
public fun setUser (Lio/sentry/protocol/User;)V
2347-
public fun startProfileSession ()V
2347+
public fun startProfiler ()V
23482348
public fun startSession ()V
23492349
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
2350-
public fun stopProfileSession ()V
2350+
public fun stopProfiler ()V
23512351
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
23522352
public fun withScope (Lio/sentry/ScopeCallback;)V
23532353
}
@@ -2411,10 +2411,10 @@ public final class io/sentry/ScopesAdapter : io/sentry/IScopes {
24112411
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
24122412
public fun setTransaction (Ljava/lang/String;)V
24132413
public fun setUser (Lio/sentry/protocol/User;)V
2414-
public fun startProfileSession ()V
2414+
public fun startProfiler ()V
24152415
public fun startSession ()V
24162416
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
2417-
public fun stopProfileSession ()V
2417+
public fun stopProfiler ()V
24182418
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
24192419
public fun withScope (Lio/sentry/ScopeCallback;)V
24202420
}
@@ -2517,14 +2517,14 @@ public final class io/sentry/Sentry {
25172517
public static fun setTag (Ljava/lang/String;Ljava/lang/String;)V
25182518
public static fun setTransaction (Ljava/lang/String;)V
25192519
public static fun setUser (Lio/sentry/protocol/User;)V
2520-
public static fun startProfileSession ()V
2520+
public static fun startProfiler ()V
25212521
public static fun startSession ()V
25222522
public static fun startTransaction (Lio/sentry/TransactionContext;)Lio/sentry/ITransaction;
25232523
public static fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
25242524
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ITransaction;
25252525
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
25262526
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
2527-
public static fun stopProfileSession ()V
2527+
public static fun stopProfiler ()V
25282528
public static fun withIsolationScope (Lio/sentry/ScopeCallback;)V
25292529
public static fun withScope (Lio/sentry/ScopeCallback;)V
25302530
}

sentry/src/main/java/io/sentry/ExperimentalOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public final class ExperimentalOptions {
3030
/**
3131
* Whether profiling can automatically be started as early as possible during the app lifecycle,
3232
* to capture more of app startup. If {@link ExperimentalOptions#profileLifecycle} is {@link
33-
* ProfileLifecycle#MANUAL} Profiling is started automatically on startup and stopProfileSession
34-
* must be called manually whenever the app startup is completed If {@link
33+
* ProfileLifecycle#MANUAL} Profiling is started automatically on startup and stopProfiler must be
34+
* called manually whenever the app startup is completed If {@link
3535
* ExperimentalOptions#profileLifecycle} is {@link ProfileLifecycle#TRACE} Profiling is started
3636
* automatically on startup, and will automatically be stopped when the root span that is
3737
* associated with app startup ends

sentry/src/main/java/io/sentry/HubAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ public boolean isAncestorOf(final @Nullable IScopes otherScopes) {
278278
}
279279

280280
@Override
281-
public void startProfileSession() {
282-
Sentry.startProfileSession();
281+
public void startProfiler() {
282+
Sentry.startProfiler();
283283
}
284284

285285
@Override
286-
public void stopProfileSession() {
287-
Sentry.stopProfileSession();
286+
public void stopProfiler() {
287+
Sentry.stopProfiler();
288288
}
289289

290290
@Override

sentry/src/main/java/io/sentry/HubScopesWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ public boolean isAncestorOf(final @Nullable IScopes otherScopes) {
278278
}
279279

280280
@Override
281-
public void startProfileSession() {
282-
scopes.startProfileSession();
281+
public void startProfiler() {
282+
scopes.startProfiler();
283283
}
284284

285285
@Override
286-
public void stopProfileSession() {
287-
scopes.stopProfileSession();
286+
public void stopProfiler() {
287+
scopes.stopProfiler();
288288
}
289289

290290
@ApiStatus.Internal

0 commit comments

Comments
 (0)