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

Commit fe9c5a5c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Skip reporting stats without enough samples

Otherwise android.perftests.utils.Stats will reject the data
and make the test fail.

Also correct a typo.

Bug: 182962701
Test: atest InternalWindowOperationPerfTest
Change-Id: I1d097f0de9a632b02d204509729f1671327285e4
parent f0931385
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public class InternalWindowOperationPerfTest extends WindowManagerPerfTestBase
            "applyPostLayoutPolicy",
            "applySurfaceChanges",
            "AppTransitionReady",
            "closeSurfaceTransactiom",
            "closeSurfaceTransaction",
            "openSurfaceTransaction",
            "performLayout",
            "performSurfacePlacement",
@@ -98,6 +98,10 @@ public class InternalWindowOperationPerfTest extends WindowManagerPerfTestBase
        }

        mTraceMarkParser.forAllSlices((key, slices) -> {
            if (slices.size() < 2) {
                Log.w(TAG, "No sufficient samples: " + key);
                return;
            }
            for (TraceMarkSlice slice : slices) {
                state.addExtraResult(key, (long) (slice.getDurationInSeconds() * NANOS_PER_S));
            }