diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-30 12:22:44 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-30 12:22:44 -0800 |
commit | 5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45 (patch) | |
tree | 96e96f3edff4f1beaf5e85f4dbad51be4132da7b /tests | |
parent | adf9b7ffa9fb29c7d7426c5a8b827bd57a917acc (diff) | |
parent | 898d47682b32bfffaa47edec9be1364c6df67eb2 (diff) | |
download | LegacyCamera-5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45.zip LegacyCamera-5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45.tar.gz LegacyCamera-5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45.tar.bz2 |
Merge change I94d56d71 into eclair
* changes:
Split the startup measurment into two parts. 1) The first startup time 2) The average of the rest of the iterations ( ie. 19)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/camera/stress/CameraStartUp.java | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java index 71325d2..b59d724 100644 --- a/tests/src/com/android/camera/stress/CameraStartUp.java +++ b/tests/src/com/android/camera/stress/CameraStartUp.java @@ -70,17 +70,22 @@ public class CameraStartUp extends InstrumentationTestCase { } private void writeToOutputFile(String startupTag, long totalStartupTime, - String individualStartupTime) throws Exception { - //TODO (yslau) : Need to integrate the output data with central dashboard + String individualStartupTime, boolean firstStartUp) throws Exception { + // TODO (yslau) : Need to integrate the output data with central + // dashboard try { FileWriter fstream = null; fstream = new FileWriter(CAMERA_TEST_OUTPUT_FILE, true); - long averageStartupTime = totalStartupTime / TOTAL_NUMBER_OF_STARTUP; BufferedWriter out = new BufferedWriter(fstream); - out.write(startupTag + "\n"); - out.write("Number of loop: " + TOTAL_NUMBER_OF_STARTUP + "\n"); - out.write(individualStartupTime + "\n\n"); - out.write("Average startup time :" + averageStartupTime + " ms\n\n"); + if (firstStartUp) { + out.write(startupTag + ": " + totalStartupTime + "\n"); + } else { + long averageStartupTime = totalStartupTime / (TOTAL_NUMBER_OF_STARTUP -1); + out.write(startupTag + "\n"); + out.write("Number of loop: " + (TOTAL_NUMBER_OF_STARTUP -1) + "\n"); + out.write(individualStartupTime + "\n\n"); + out.write("Average startup time :" + averageStartupTime + " ms\n\n"); + } out.close(); fstream.close(); } catch (Exception e) { @@ -94,29 +99,41 @@ public class CameraStartUp extends InstrumentationTestCase { individualStartupTime = "Individual Video Startup Time = "; long totalStartupTime = 0; long startupTime = 0; - for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){ - startupTime = launchVideo(); - totalStartupTime += startupTime; - individualStartupTime += startupTime + " ,"; + for (int i = 0; i < TOTAL_NUMBER_OF_STARTUP; i++) { + if (i == 0) { + // Capture the first startup time individually + long firstStartUpTime = launchVideo(); + writeToOutputFile("First Video Startup: ", firstStartUpTime, "na", true); + } else { + startupTime = launchVideo(); + totalStartupTime += startupTime; + individualStartupTime += startupTime + " ,"; + } } Log.v(TAG, "totalStartupTime =" + totalStartupTime); writeToOutputFile("Video Recorder Startup Time: ", totalStartupTime, - individualStartupTime); + individualStartupTime, false); } @LargeTest public void testLaunchCamera() throws Exception { String individualStartupTime; individualStartupTime = "Individual Camera Startup Time = "; - long totalStartupTime =0; + long totalStartupTime = 0; long startupTime = 0; - for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){ - startupTime = launchCamera(); - totalStartupTime += startupTime; - individualStartupTime += startupTime + " ,"; + for (int i = 0; i < TOTAL_NUMBER_OF_STARTUP; i++) { + if (i == 0) { + // Capture the first startup time individually + long firstStartUpTime = launchCamera(); + writeToOutputFile("First Camera Startup: ", firstStartUpTime, "na", true); + } else { + startupTime = launchCamera(); + totalStartupTime += startupTime; + individualStartupTime += startupTime + " ,"; + } } Log.v(TAG, "totalStartupTime =" + totalStartupTime); writeToOutputFile("Camera Startup Time: ", totalStartupTime, - individualStartupTime); + individualStartupTime, false); } }
\ No newline at end of file |