-
- All Implemented Interfaces:
-
io.sentry.IContinuousProfiler,io.sentry.transport.RateLimiter.IRateLimitObserver
@ApiStatus.Internal()@RequiresApi(api = Build.VERSION_CODES.VANILLA_ICE_CREAM) public class PerfettoContinuousProfiler implements IContinuousProfiler, RateLimiter.IRateLimitObserver
Continuous profiler that uses Android's android.os.ProfilingManager (API 35+) to capture Perfetto stack-sampling traces.
This class is intentionally separate from AndroidContinuousProfiler to keep the two profiling backends independent. All ProfilingManager API usage is confined to this file and PerfettoProfiler.
Currently, this class doesn't do app-start profiling SentryPerformanceProvider. It is created during
{@code Sentry.init()}.Thread safety: all mutable state is guarded by a single . Public entry points (startProfiler, , close, onRateLimitChanged, reevaluateSampling, and the getters) acquire the lock themselves and are thread-safe. Private methods
{@code startInternal}and{@code stopInternal}require the caller to hold the lock.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisRunningprivate SentryIdprofilerIdprivate SentryIdchunkId
-
Constructor Summary
Constructors Constructor Description PerfettoContinuousProfiler(ILogger logger, SentryFrameMetricsCollector frameMetricsCollector, LazyEvaluator.Evaluator<ISentryExecutorService> executorServiceSupplier, Supplier<PerfettoProfiler> perfettoProfilerFactory)
-
Method Summary
Modifier and Type Method Description booleanisRunning()SentryIdgetProfilerId()SentryIdgetChunkId()voidstartProfiler(@NotNull() ProfileLifecycle profileLifecycle, @NotNull() TracesSampler tracesSampler)voidstopProfiler(@NotNull() ProfileLifecycle profileLifecycle)voidonRateLimitChanged(@NotNull() RateLimiter rateLimiter)Stop the profiler as soon as we are rate limited, to avoid the performance overhead. voidclose(boolean isTerminating)voidreevaluateSampling()-
Methods inherited from class io.sentry.IContinuousProfiler
close, getChunkId, getProfilerId, isRunning, reevaluateSampling, startProfiler, stopProfiler -
Methods inherited from class io.sentry.transport.RateLimiter.IRateLimitObserver
onRateLimitChanged -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PerfettoContinuousProfiler
PerfettoContinuousProfiler(ILogger logger, SentryFrameMetricsCollector frameMetricsCollector, LazyEvaluator.Evaluator<ISentryExecutorService> executorServiceSupplier, Supplier<PerfettoProfiler> perfettoProfilerFactory)
-
-
Method Detail
-
isRunning
boolean isRunning()
-
getProfilerId
@NotNull() SentryId getProfilerId()
-
getChunkId
@NotNull() SentryId getChunkId()
-
startProfiler
void startProfiler(@NotNull() ProfileLifecycle profileLifecycle, @NotNull() TracesSampler tracesSampler)
-
stopProfiler
void stopProfiler(@NotNull() ProfileLifecycle profileLifecycle)
-
onRateLimitChanged
void onRateLimitChanged(@NotNull() RateLimiter rateLimiter)
Stop the profiler as soon as we are rate limited, to avoid the performance overhead.
- Parameters:
rateLimiter- the RateLimiter instance to check categories against
-
close
void close(boolean isTerminating)
-
reevaluateSampling
void reevaluateSampling()
-
-
-
-