blob: 77e0e90623fa05fd6fedd729e585e21dcebb6af6 [file] [log] [blame]
Arthur Eubanks263d6742017-12-18 13:46:59 -08001ActivityManagerPerfTests
2
3Performance tests for various ActivityManager components, e.g. Services, Broadcasts
4
5Command to run tests (not working yet, atest seems buggy)
6* atest .../frameworks/base/tests/ActivityManagerPerfTests
7* m ActivityManagerPerfTests ActivityManagerPerfTestsTestApp && \
8 adb install $OUT/data/app/ActivityManagerPerfTests/ActivityManagerPerfTests.apk && \
9 adb install $OUT/data/app/ActivityManagerPerfTestsTestApp/ActivityManagerPerfTestsTestApp.apk && \
10 adb shell am instrument -w \
11 com.android.frameworks.perftests.amtests/android.support.test.runner.AndroidJUnitRunner
12
13Overview
14* The numbers we are trying to measure are end-to-end numbers
15 * For example, the time it takes from sending an Intent to start a Service
16 to the time the Service runs its callbacks
17* System.nanoTime() is monotonic and consistent between processes, so we use that for measuring time
18* To make sure the test app is running, we start an Activity
19* If the test app is involved, it will measure the time and send it back to the instrumentation test
20 * The time is sent back through a Binder interface in the Intent
21 * Each sent time is tagged with an id since there can be multiple events that send back a time
22 * For example, one is sent when the Activity is started, and another could be sent when a
23 Broadcast is received
24
25Structure
26* tests
27 * Instrumentation test which runs the various performance tests and reports the results
28
29* test-app
30 * Target package which contains the Services, BroadcastReceivers, etc. to test against
31 * Sends the time it measures back to the test package
32
33* utils
34 * Utilities that both the instrumentation test and test app can use