out.write("Sdk package size\t: " + sdkPackageSize);\r
out.newLine();\r
out.write("The initialization time\t: " + getInitializeTime() + "sec");\r
- out.write("(" + getBitPerSecond(sdkPackageSize, getInitializeTime())+ "b/s)");\r
+ out.write("(" + getKBPerSecond(sdkPackageSize, getInitializeTime())+ "kb/s)");\r
out.newLine();\r
out.write("The download time\t: " + getDownloadTime() + "sec");\r
- out.write("(" + getBitPerSecond(sdkPackageSize, getDownloadTime())+ "b/s)");\r
+ out.write("(" + getKBPerSecond(sdkPackageSize, getDownloadTime())+ "kb/s)");\r
out.newLine();\r
out.write("The installation time\t: " + getInstallationTime() + "sec");\r
- out.write("(" + getBitPerSecond(sdkPackageSize, getInstallationTime())+ "b/s)");\r
+ out.write("(" + getKBPerSecond(sdkPackageSize, getInstallationTime())+ "kb/s)");\r
+ out.newLine();\r
+ out.write("The total installation time\t: " + getTotalInstallationTime() + "sec");\r
+ out.write("(" + getKBPerSecond(sdkPackageSize, getTotalInstallationTime())+ "kb/s)");\r
out.newLine();\r
out.write("The removal time\t: " + getRemovalTime() + "sec");\r
- out.write("(" + getBitPerSecond(sdkPackageSize, getRemovalTime())+ "b/s)");\r
+ out.write("(" + getKBPerSecond(sdkPackageSize, getRemovalTime())+ "b/s)");\r
out.newLine();\r
out.write("The install-manager start time\t: " + imStartTime);\r
out.newLine();\r
}\r
\r
public static void printTestResultXmlFormat() {\r
- //get file name of test result\r
- SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");\r
- String testFileName = formatter.format(imStartTime) + ".xml";\r
- \r
- String testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath(), testFileName);\r
- File testResultFile = new File(testResultFilePath);\r
- \r
- if (!testResultFile.getParentFile().exists()) {\r
- testResultFile.getParentFile().mkdirs();\r
- }\r
- \r
- BufferedWriter out = null;\r
- try {\r
- out = new BufferedWriter(new FileWriter(testResultFile));\r
- out.write(getTestSuiteXml("InstallManager performance test", 4, getTotalTime()));\r
- out.newLine();\r
- out.write(getTestCaseXml("InitTest", "The initialization time", getInitializeTime()));\r
- out.newLine();\r
- out.write(getTestCaseXml("DownloadTest", "The download time", getDownloadTime()));\r
- out.newLine();\r
- out.write(getTestCaseXml("InstallTest", "The installation time", getInstallationTime()));\r
- out.newLine();\r
- out.write(getTestCaseXml("RemoveTest", "The removal time", getRemovalTime()));\r
- out.newLine();\r
- out.write("</testsuite>");\r
- } catch (IOException e) {\r
- Log.ExceptionLog(e);\r
- } finally {\r
- if (out != null) {\r
- try {\r
- out.close();\r
- } catch (IOException e) {\r
- Log.ExceptionLog(e);\r
- }\r
- }\r
- }\r
- }\r
- \r
- public static void printTestResultXmlFormat2() {\r
if (installationStartTime != null) {\r
printInstallTestResultXmlFormat();\r
} else {\r
out.newLine();\r
out.write(getTestCaseXml("InstallTest", "The installation time", getInstallationTime()));\r
out.newLine();\r
+ out.write(getTestCaseXml("TotalInstallationTest", "Total installation time", getTotalInstallationTime()));\r
out.write("</testsuite>");\r
} catch (IOException e) {\r
Log.ExceptionLog(e);\r
return interval;\r
}\r
\r
+ private static long getTotalInstallationTime() {\r
+ if (downloadStartTime == null || installationEndTime == null) {\r
+ return 0;\r
+ }\r
+ \r
+ long interval = (installationEndTime.getTime() - downloadStartTime.getTime())/1000;\r
+ return interval;\r
+ }\r
+ \r
private static long getRemovalTime() {\r
if (removalStartTime == null || removalEndTime == null) {\r
return 0;\r
return interval;\r
}\r
\r
- private static long getBitPerSecond(long size, long seconds) {\r
+ private static long getKBPerSecond(long size, long seconds) {\r
if (seconds == 0) {\r
return 0;\r
} else {\r
- return size/seconds;\r
+ return (size/1024/seconds);\r
}\r
}\r
}\r