@@ -12,9 +12,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
1212import androidx.test.ext.junit.runners.AndroidJUnit4
1313import androidx.test.runner.AndroidJUnitRunner
1414import io.sentry.ITransaction
15- import io.sentry.Sentry
1615import io.sentry.Sentry.OptionsConfiguration
17- import io.sentry.SentryOptions
1816import io.sentry.android.core.SentryAndroid
1917import io.sentry.android.core.SentryAndroidOptions
2018import io.sentry.test.applyTestOptions
@@ -71,49 +69,6 @@ class SentryBenchmarkTest : BaseBenchmarkTest() {
7169 // respectively.
7270 }
7371
74- @Test
75- fun benchmarkProfiledTransaction () {
76- // We compare the same operation with and without profiled transaction.
77- // We expect the profiled transaction operation to be slower, but not slower than 5%.
78- val benchmarkOperationNoTransaction =
79- BenchmarkOperation (choreographer, op = getOperation(runner))
80- val benchmarkOperationProfiled =
81- BenchmarkOperation (
82- choreographer,
83- before = {
84- runner.runOnMainSync {
85- initForTest(context) { options: SentryOptions ->
86- options.dsn = " https://key@uri/1234567"
87- options.tracesSampleRate = 1.0
88- options.profilesSampleRate = 1.0
89- options.isEnableAutoSessionTracking = false
90- }
91- }
92- },
93- op = getOperation(runner) { Sentry .startTransaction(" Benchmark" , " ProfiledTransaction" ) },
94- after = { runner.runOnMainSync { Sentry .close() } },
95- )
96- val refreshRate = BenchmarkActivity .refreshRate ? : 60F
97- val comparisonResults =
98- BenchmarkOperation .compare(
99- benchmarkOperationNoTransaction,
100- " NoTransaction" ,
101- benchmarkOperationProfiled,
102- " ProfiledTransaction" ,
103- refreshRate,
104- measuredIterations = 40 ,
105- )
106- comparisonResults.printAllRuns(" Profiling Benchmark" )
107- val comparisonResult = comparisonResults.getSummaryResult()
108- comparisonResult.printResults()
109-
110- // Currently we just want to assert the cpu overhead
111- assertTrue(
112- comparisonResult.cpuTimeIncreasePercentage in 0F .. 5.5F ,
113- " Expected ${comparisonResult.cpuTimeIncreasePercentage} to be in range 0 < x < 5.5" ,
114- )
115- }
116-
11772 /* *
11873 * Operation that will be compared: it launches [BenchmarkActivity], swipe the list and closes it.
11974 * The [transactionBuilder] is used to create the transaction before the swipes.
0 commit comments