summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/camera/stress/CameraStartUp.java
diff options
context:
space:
mode:
authorYu Shan Emily Lau <yslau@google.com>2009-07-16 14:20:32 -0700
committerYu Shan Emily Lau <yslau@google.com>2009-07-16 14:23:32 -0700
commit6dac837de88ba85addbb44728415f8e48013d5b5 (patch)
tree00e2fb8fa9cb10259a181b5b3b8745d7e812ce20 /tests/src/com/android/camera/stress/CameraStartUp.java
parent92eedd640affe6bac8f8a32414d5496d7be3b643 (diff)
downloadLegacyCamera-6dac837de88ba85addbb44728415f8e48013d5b5.zip
LegacyCamera-6dac837de88ba85addbb44728415f8e48013d5b5.tar.gz
LegacyCamera-6dac837de88ba85addbb44728415f8e48013d5b5.tar.bz2
Capture individual camera and video startup time and output to a text file.
Diffstat (limited to 'tests/src/com/android/camera/stress/CameraStartUp.java')
-rw-r--r--tests/src/com/android/camera/stress/CameraStartUp.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java
index 95bca31..71325d2 100644
--- a/tests/src/com/android/camera/stress/CameraStartUp.java
+++ b/tests/src/com/android/camera/stress/CameraStartUp.java
@@ -69,7 +69,8 @@ public class CameraStartUp extends InstrumentationTestCase {
return startupTime;
}
- private void writeToOutputFile(String startupTag, long totalStartupTime) throws Exception {
+ private void writeToOutputFile(String startupTag, long totalStartupTime,
+ String individualStartupTime) throws Exception {
//TODO (yslau) : Need to integrate the output data with central dashboard
try {
FileWriter fstream = null;
@@ -78,6 +79,7 @@ public class CameraStartUp extends InstrumentationTestCase {
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");
out.close();
fstream.close();
@@ -88,21 +90,33 @@ public class CameraStartUp extends InstrumentationTestCase {
@LargeTest
public void testLaunchVideo() throws Exception {
- long totalStartupTime =0;
+ String individualStartupTime;
+ individualStartupTime = "Individual Video Startup Time = ";
+ long totalStartupTime = 0;
+ long startupTime = 0;
for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){
- totalStartupTime += launchVideo();
+ startupTime = launchVideo();
+ totalStartupTime += startupTime;
+ individualStartupTime += startupTime + " ,";
}
Log.v(TAG, "totalStartupTime =" + totalStartupTime);
- writeToOutputFile("Video Recorder Startup Time: ", totalStartupTime);
+ writeToOutputFile("Video Recorder Startup Time: ", totalStartupTime,
+ individualStartupTime);
}
@LargeTest
public void testLaunchCamera() throws Exception {
+ String individualStartupTime;
+ individualStartupTime = "Individual Camera Startup Time = ";
long totalStartupTime =0;
+ long startupTime = 0;
for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){
- totalStartupTime += launchCamera();
+ startupTime = launchCamera();
+ totalStartupTime += startupTime;
+ individualStartupTime += startupTime + " ,";
}
Log.v(TAG, "totalStartupTime =" + totalStartupTime);
- writeToOutputFile("Camera Startup Time: ", totalStartupTime);
+ writeToOutputFile("Camera Startup Time: ", totalStartupTime,
+ individualStartupTime);
}
} \ No newline at end of file