Skip to content

Commit b4b28c9

Browse files
43jayclaude
andcommitted
chore: Run spotlessApply and apiDump
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2b8d0c commit b4b28c9

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public final class io/sentry/android/core/ActivityLifecycleIntegration : android
4343
public class io/sentry/android/core/AndroidContinuousProfiler : io/sentry/IContinuousProfiler, io/sentry/transport/RateLimiter$IRateLimitObserver {
4444
public fun close (Z)V
4545
public static fun createLegacy (Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;Ljava/lang/String;ILio/sentry/util/LazyEvaluator$Evaluator;)Lio/sentry/android/core/AndroidContinuousProfiler;
46-
public static fun createWithProfilingManager (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;Lio/sentry/util/LazyEvaluator$Evaluator;)Lio/sentry/android/core/AndroidContinuousProfiler;
4746
public fun getChunkId ()Lio/sentry/protocol/SentryId;
4847
public fun getProfilerId ()Lio/sentry/protocol/SentryId;
4948
public fun getRootSpanCounter ()I
@@ -339,6 +338,19 @@ public final class io/sentry/android/core/NetworkBreadcrumbsIntegration : io/sen
339338
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
340339
}
341340

341+
public class io/sentry/android/core/PerfettoContinuousProfiler : io/sentry/IContinuousProfiler, io/sentry/transport/RateLimiter$IRateLimitObserver {
342+
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;Lio/sentry/util/LazyEvaluator$Evaluator;)V
343+
public fun close (Z)V
344+
public fun getActiveTraceCount ()I
345+
public fun getChunkId ()Lio/sentry/protocol/SentryId;
346+
public fun getProfilerId ()Lio/sentry/protocol/SentryId;
347+
public fun isRunning ()Z
348+
public fun onRateLimitChanged (Lio/sentry/transport/RateLimiter;)V
349+
public fun reevaluateSampling ()V
350+
public fun startProfiler (Lio/sentry/ProfileLifecycle;Lio/sentry/TracesSampler;)V
351+
public fun stopProfiler (Lio/sentry/ProfileLifecycle;)V
352+
}
353+
342354
public class io/sentry/android/core/PerfettoProfiler {
343355
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;)V
344356
public fun endAndCollect ()Lio/sentry/android/core/AndroidProfiler$ProfileEndData;

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@
3939
* Perfetto stack-sampling traces.
4040
*
4141
* <p>This class is intentionally separate from {@link AndroidContinuousProfiler} to keep the two
42-
* profiling backends independent. All ProfilingManager API usage is confined to this file and {@link
43-
* PerfettoProfiler}.
42+
* profiling backends independent. All ProfilingManager API usage is confined to this file and
43+
* {@link PerfettoProfiler}.
4444
*
4545
* <p>Unlike the legacy profiler, this class is not used for app-start profiling. It is created
4646
* during {@code Sentry.init()}, so scopes are always available when {@link #startProfiler} is
4747
* called.
4848
*
4949
* <p>Thread safety: all mutable state is guarded by a single {@link
5050
* io.sentry.util.AutoClosableReentrantLock}. Public entry points ({@link #startProfiler}, {@link
51-
* #stopProfiler}, {@link #close}, {@link #onRateLimitChanged}, {@link #reevaluateSampling}, and
52-
* the getters) acquire the lock themselves. Private methods {@code startInternal} and {@code
51+
* #stopProfiler}, {@link #close}, {@link #onRateLimitChanged}, {@link #reevaluateSampling}, and the
52+
* getters) acquire the lock themselves. Private methods {@code startInternal} and {@code
5353
* stopInternal} require the caller to hold the lock.
5454
*/
5555
@ApiStatus.Internal
@@ -74,8 +74,7 @@ public class PerfettoContinuousProfiler
7474
private @NotNull SentryId profilerId = SentryId.EMPTY_ID;
7575
private @NotNull SentryId chunkId = SentryId.EMPTY_ID;
7676
private final @NotNull AtomicBoolean isClosed = new AtomicBoolean(false);
77-
private @NotNull SentryDate startProfileChunkTimestamp =
78-
new io.sentry.SentryNanotimeDate();
77+
private @NotNull SentryDate startProfileChunkTimestamp = new io.sentry.SentryNanotimeDate();
7978
private boolean shouldSample = true;
8079
private boolean shouldStop = false;
8180
private boolean isSampled = false;
@@ -202,9 +201,9 @@ public boolean isRunning() {
202201
}
203202

204203
/**
205-
* Resolves scopes on first call. Since PerfettoContinuousProfiler is created during
206-
* Sentry.init() and never used for app-start profiling, scopes is guaranteed to be available by
207-
* the time startProfiler is called.
204+
* Resolves scopes on first call. Since PerfettoContinuousProfiler is created during Sentry.init()
205+
* and never used for app-start profiling, scopes is guaranteed to be available by the time
206+
* startProfiler is called.
208207
*
209208
* <p>Caller must hold {@link #lock}.
210209
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import io.sentry.profilemeasurements.ProfileMeasurementValue;
1616
import java.io.File;
1717
import java.util.HashMap;
18-
import java.util.concurrent.ConcurrentLinkedDeque;
1918
import java.util.Map;
19+
import java.util.concurrent.ConcurrentLinkedDeque;
2020
import java.util.concurrent.CountDownLatch;
2121
import java.util.concurrent.TimeUnit;
2222
import java.util.function.Consumer;

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ class PerfettoContinuousProfilerTest {
6161

6262
init {
6363
whenever(mockTracesSampler.sampleSessionProfile(any())).thenReturn(true)
64-
whenever(mockPerfettoProfiler.start(any())).thenReturn(
65-
AndroidProfiler.ProfileStartData(
66-
System.nanoTime(),
67-
0L,
68-
io.sentry.DateUtils.getCurrentDateTime(),
69-
),
70-
)
64+
whenever(mockPerfettoProfiler.start(any()))
65+
.thenReturn(
66+
AndroidProfiler.ProfileStartData(
67+
System.nanoTime(),
68+
0L,
69+
io.sentry.DateUtils.getCurrentDateTime(),
70+
)
71+
)
7172
}
7273

7374
fun getSut(): PerfettoContinuousProfiler {

0 commit comments

Comments
 (0)