Unable to read any metrics during benchmark
See original GitHub issueandroidx.benchmark:benchmark-macro-junit4:1.1.0-beta04
java.lang.IllegalArgumentException: Unable to read any metrics during benchmark (metric list: [androidx.benchmark.macro.StartupTimingMetric@ac86f88]).
Check that you're performing the operations to be measured. For example, if
using StartupTimingMetric, are you starting an activity for the specified package
in the measure block?
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:237)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:301)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:102)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated$default(MacrobenchmarkRule.kt:92)
at com.example.benchmark.BaselineProfileBenchmark.startup(BaselineProfileBenchmark.kt:40)
at com.example.benchmark.BaselineProfileBenchmark.startupNoCompilation(BaselineProfileBenchmark.kt:31)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unable to read any metrics during benchmark ... - Issue Tracker
I was trying to upgrade my macrobenchmark version from 1.1.0-alpha02 to 1.1.0-alpha07. And now I'm always encountered this error: There was 1 failure:...
Read more >Benchmark - Android Developers
Accurately measure your code's performance within Android Studio. ... This is expected to fix "Unable to read any metrics during benchmark" exceptions that ......
Read more >Jetpack Macrobenchmark Guide - android Git repositories
If you see exceptions with the text: Unable to read any metrics during benchmark or Error, different metrics observed in different iterations. in...
Read more >Source Code for Macrobenchmark.kt - AndroidX Tech
package androidx.benchmark.macro import android.content.pm. ... isNotEmpty()) { """ Unable to read any metrics during benchmark (metric list: $metrics).
Read more >Why Benchmarking Efforts Fail - Quality America Inc.
Focus on metrics rather than processes Some firms focus their benchmarking efforts on performance targets (metrics) rather than processes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is still here in
1.1.0
on the devices lower than API level 29 if release build of the app is used. Some mandatory traces, likestartActivityAndWait
are missing from captured .trace files because release builds are not traceable.Starting API 29 there is a new manifest flag which allows to collect traces from release builds when set on both the app and the test app.
The only way to make it work on API 28 is to use debug builds.
When relying on debug builds for benchmarking you won’t be able to see real world performance of your app. The macrobenchmark library works down to API 23. Some traces might not be available depending on the specific device you’re using. Which device & OS version are you using to capture traces?