-
@ApiStatus.Internal()@RequiresApi(api = Build.VERSION_CODES.VANILLA_ICE_CREAM) public class PerfettoProfiler
Wraps Android's ProfilingManager API for a single Perfetto stack-sampling session.
Each instance is single-use: call start once, then endAndCollect once. For a new profiling session, create a new instance.
-
-
Constructor Summary
Constructors Constructor Description PerfettoProfiler(Context context, ILogger logger, ISentryExecutorService executorService)
-
Method Summary
Modifier and Type Method Description booleanstart(long durationMs)voidendAndCollect(@NotNull() Consumer<File> listener)Cancels the current profiling session. -
-
Constructor Detail
-
PerfettoProfiler
PerfettoProfiler(Context context, ILogger logger, ISentryExecutorService executorService)
-
-
Method Detail
-
start
boolean start(long durationMs)
-
endAndCollect
void endAndCollect(@NotNull() Consumer<File> listener)
Cancels the current profiling session. The listener is called with the trace file (or null onerror) once the OS delivers the result. The listener may be called synchronously if the resulthas already arrived, or asynchronously on an OS-managed thread otherwise.
-
-
-
-