Loading apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkResults.java +7 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,13 @@ public class BenchmarkResults { mResults.add(TimeUnit.NANOSECONDS.toMillis(duration)); } public Bundle getStats() { public Bundle getStatsToReport() { final Bundle stats = new Bundle(); stats.putDouble("Mean (ms)", mean()); return stats; } public Bundle getStatsToLog() { final Bundle stats = new Bundle(); stats.putDouble("Mean (ms)", mean()); stats.putDouble("Median (ms)", median()); Loading apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkResultsReporter.java +5 −3 Original line number Diff line number Diff line Loading @@ -40,9 +40,11 @@ public class BenchmarkResultsReporter implements TestRule { @Override public void evaluate() throws Throwable { base.evaluate(); final Bundle stats = mRunner.getStats(); final String summary = getSummaryString(description.getMethodName(), stats); logSummary(description.getTestClass().getSimpleName(), summary, mRunner.getAllDurations()); final Bundle stats = mRunner.getStatsToReport(); final String summary = getSummaryString(description.getMethodName(), mRunner.getStatsToLog()); logSummary(description.getTestClass().getSimpleName(), summary, mRunner.getAllDurations()); stats.putString(Instrumentation.REPORT_KEY_STREAMRESULT, summary); InstrumentationRegistry.getInstrumentation().sendStatus( Activity.RESULT_OK, stats); Loading apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkRunner.java +6 −2 Original line number Diff line number Diff line Loading @@ -93,8 +93,12 @@ public class BenchmarkRunner { mState = RUNNING; } public Bundle getStats() { return mResults.getStats(); public Bundle getStatsToReport() { return mResults.getStatsToReport(); } public Bundle getStatsToLog() { return mResults.getStatsToLog(); } public ArrayList<Long> getAllDurations() { Loading apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTest.java→apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +7 −5 Original line number Diff line number Diff line Loading @@ -49,19 +49,21 @@ import java.util.concurrent.TimeUnit; * make MultiUserPerfTests && * adb install -r \ * ${ANDROID_PRODUCT_OUT}/data/app/MultiUserPerfTests/MultiUserPerfTests.apk && * adb shell am instrument -e class android.multiuser.UserLifecycleTest \ * adb shell am instrument -e class android.multiuser.UserLifecycleTests \ * -w com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner * * or * * bit MultiUserPerfTests:android.multiuser.UserLifecycleTest * bit MultiUserPerfTests:android.multiuser.UserLifecycleTests * * Note: If you use bit for running the tests, benchmark results won't be printed on the host side. * But in either case, results can be checked on the device side 'adb logcat -s UserLifecycleTest' * But in either case, results can be checked on the device side 'adb logcat -s UserLifecycleTests' */ @LargeTest @RunWith(AndroidJUnit4.class) public class UserLifecycleTest { public class UserLifecycleTests { private static final String TAG = UserLifecycleTests.class.getSimpleName(); private final int TIMEOUT_IN_SECOND = 30; private final int CHECK_USER_REMOVED_INTERVAL_MS = 200; Loading Loading @@ -276,7 +278,7 @@ public class UserLifecycleTest { bootCompleteLatch.countDown(); } } }, "UserLifecycleTest"); }, TAG); } private void registerBroadcastReceiver(final String action, final CountDownLatch latch, Loading Loading
apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkResults.java +7 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,13 @@ public class BenchmarkResults { mResults.add(TimeUnit.NANOSECONDS.toMillis(duration)); } public Bundle getStats() { public Bundle getStatsToReport() { final Bundle stats = new Bundle(); stats.putDouble("Mean (ms)", mean()); return stats; } public Bundle getStatsToLog() { final Bundle stats = new Bundle(); stats.putDouble("Mean (ms)", mean()); stats.putDouble("Median (ms)", median()); Loading
apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkResultsReporter.java +5 −3 Original line number Diff line number Diff line Loading @@ -40,9 +40,11 @@ public class BenchmarkResultsReporter implements TestRule { @Override public void evaluate() throws Throwable { base.evaluate(); final Bundle stats = mRunner.getStats(); final String summary = getSummaryString(description.getMethodName(), stats); logSummary(description.getTestClass().getSimpleName(), summary, mRunner.getAllDurations()); final Bundle stats = mRunner.getStatsToReport(); final String summary = getSummaryString(description.getMethodName(), mRunner.getStatsToLog()); logSummary(description.getTestClass().getSimpleName(), summary, mRunner.getAllDurations()); stats.putString(Instrumentation.REPORT_KEY_STREAMRESULT, summary); InstrumentationRegistry.getInstrumentation().sendStatus( Activity.RESULT_OK, stats); Loading
apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkRunner.java +6 −2 Original line number Diff line number Diff line Loading @@ -93,8 +93,12 @@ public class BenchmarkRunner { mState = RUNNING; } public Bundle getStats() { return mResults.getStats(); public Bundle getStatsToReport() { return mResults.getStatsToReport(); } public Bundle getStatsToLog() { return mResults.getStatsToLog(); } public ArrayList<Long> getAllDurations() { Loading
apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTest.java→apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +7 −5 Original line number Diff line number Diff line Loading @@ -49,19 +49,21 @@ import java.util.concurrent.TimeUnit; * make MultiUserPerfTests && * adb install -r \ * ${ANDROID_PRODUCT_OUT}/data/app/MultiUserPerfTests/MultiUserPerfTests.apk && * adb shell am instrument -e class android.multiuser.UserLifecycleTest \ * adb shell am instrument -e class android.multiuser.UserLifecycleTests \ * -w com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner * * or * * bit MultiUserPerfTests:android.multiuser.UserLifecycleTest * bit MultiUserPerfTests:android.multiuser.UserLifecycleTests * * Note: If you use bit for running the tests, benchmark results won't be printed on the host side. * But in either case, results can be checked on the device side 'adb logcat -s UserLifecycleTest' * But in either case, results can be checked on the device side 'adb logcat -s UserLifecycleTests' */ @LargeTest @RunWith(AndroidJUnit4.class) public class UserLifecycleTest { public class UserLifecycleTests { private static final String TAG = UserLifecycleTests.class.getSimpleName(); private final int TIMEOUT_IN_SECOND = 30; private final int CHECK_USER_REMOVED_INTERVAL_MS = 200; Loading Loading @@ -276,7 +278,7 @@ public class UserLifecycleTest { bootCompleteLatch.countDown(); } } }, "UserLifecycleTest"); }, TAG); } private void registerBroadcastReceiver(final String action, final CountDownLatch latch, Loading