Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a90b243e authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Improving jank tests diagnostics

When there were 0 total frames, ProfileData generates something like:
Janky frames: 0 (nan%)

Then the test fails to parse it, and ends up with a mysterious
"Failed to parse NUM_JANKY" diag (see the bug).

Making the case 0/0 a 0%.

Bug: 77528721
Test: atest google/perf/jank/SystemUI/UbSystemUIJankTests:android.platform.systemui.tests.jank.LauncherJankTests#testOpenAllAppsContainer
Change-Id: Ib65b80dc689f7b6ee06b108114ffd7de9d739721
parent 271ba383
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ void ProfileData::dump(int fd) const {
    dprintf(fd, "\nStats since: %" PRIu64 "ns", mStatStartTime);
    dprintf(fd, "\nTotal frames rendered: %u", mTotalFrameCount);
    dprintf(fd, "\nJanky frames: %u (%.2f%%)", mJankFrameCount,
            mTotalFrameCount == 0 ? 0.0f :
                (float)mJankFrameCount / (float)mTotalFrameCount * 100.0f);
    dprintf(fd, "\n50th percentile: %ums", findPercentile(50));
    dprintf(fd, "\n90th percentile: %ums", findPercentile(90));