File tree Expand file tree Collapse file tree
main/java/io/sentry/android/core
test/java/io/sentry/android/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io .sentry .android .core ;
22
33import static io .sentry .android .core .NdkIntegration .SENTRY_NDK_CLASS_NAME ;
4+ import static io .sentry .util .IntegrationUtils .addIntegrationToSdkVersion ;
45
56import android .annotation .SuppressLint ;
67import android .app .Application ;
@@ -378,6 +379,8 @@ private static void setupProfiler(
378379 () ->
379380 new PerfettoProfiler (
380381 appContext , options .getLogger (), options .getExecutorService ())));
382+ // Report adoption of the Perfetto continuous profiling backend (API 35+).
383+ addIntegrationToSdkVersion ("PerfettoContinuousProfiling" );
381384 } else if (options .isEnableLegacyProfiling ()) {
382385 options .setContinuousProfiler (
383386 new AndroidContinuousProfiler (
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import io.sentry.ITransactionProfiler
1717import io.sentry.MainEventProcessor
1818import io.sentry.NoOpContinuousProfiler
1919import io.sentry.NoOpTransactionProfiler
20+ import io.sentry.SentryIntegrationPackageStorage
2021import io.sentry.SentryOptions
2122import io.sentry.android.core.SentryAndroidOptions.AndroidUserFeedbackFormHandler
2223import io.sentry.android.core.cache.AndroidEnvelopeCache
@@ -383,6 +384,32 @@ class AndroidOptionsInitializerTest {
383384 assertTrue(fixture.sentryOptions.continuousProfiler is PerfettoContinuousProfiler )
384385 }
385386
387+ @Config(sdk = [35 ])
388+ @Test
389+ fun `init on API 35+ reports PerfettoContinuousProfiling integration` () {
390+ SentryIntegrationPackageStorage .getInstance().clearStorage()
391+ fixture.initSut()
392+
393+ assertTrue(
394+ SentryIntegrationPackageStorage .getInstance()
395+ .integrations
396+ .contains(" PerfettoContinuousProfiling" )
397+ )
398+ }
399+
400+ @Config(sdk = [34 ])
401+ @Test
402+ fun `init below API 35 does not report PerfettoContinuousProfiling integration` () {
403+ SentryIntegrationPackageStorage .getInstance().clearStorage()
404+ fixture.initSut(configureOptions = { isEnableLegacyProfiling = true })
405+
406+ assertFalse(
407+ SentryIntegrationPackageStorage .getInstance()
408+ .integrations
409+ .contains(" PerfettoContinuousProfiling" )
410+ )
411+ }
412+
386413 @Config(sdk = [34 ])
387414 @Test
388415 fun `init below API 35 with enableLegacyProfiling true sets AndroidContinuousProfiler` () {
You can’t perform that action at this time.
0 commit comments