From 387881181abf691336046ff1de0c2c0bf902ba3e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 8 Dec 2022 02:41:00 +0530 Subject: [PATCH] feat(benchmark): switch to new `BaselineProfileRule.collectStableBaselineProfile` API --- .../msfjarvis/claw/benchmark/BaselineProfileGenerator.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt index 11f3176d..2740e90f 100644 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt +++ b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt @@ -6,6 +6,7 @@ */ package dev.msfjarvis.claw.benchmark +import androidx.benchmark.macro.ExperimentalStableBaselineProfilesApi import androidx.benchmark.macro.junit4.BaselineProfileRule import androidx.test.filters.MediumTest import androidx.test.platform.app.InstrumentationRegistry @@ -14,6 +15,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test +@ExperimentalStableBaselineProfilesApi @MediumTest class BaselineProfileGenerator { @get:Rule val baselineProfileRule = BaselineProfileRule() @@ -27,5 +29,10 @@ class BaselineProfileGenerator { @Test fun startup() = - baselineProfileRule.collectBaselineProfile(packageName = PACKAGE_NAME) { exploreUI(device) } + baselineProfileRule.collectStableBaselineProfile( + packageName = PACKAGE_NAME, + maxIterations = 5, + ) { + exploreUI(device) + } }