question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to read any metrics during benchmark

See original GitHub issue

androidx.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:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zeaccommented, Jun 27, 2022

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, like startActivityAndWait 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.

0reactions
keyboardsurfercommented, Nov 28, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found