[Title]modify performance test
authorshihyun <shihyun@shihyun-Samsung-Desktop-System.(none)>
Wed, 31 Jul 2013 01:52:52 +0000 (10:52 +0900)
committershihyun <shihyun@shihyun-Samsung-Desktop-System.(none)>
Wed, 31 Jul 2013 01:52:52 +0000 (10:52 +0900)
InstallManager_java/installmanager.conf
InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java
InstallManager_java/src/org/tizen/installmanager/cli/CliUninstall.java
InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java
InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java
package/pkginfo.manifest

index 30c55f2..34e52b1 100644 (file)
@@ -4,6 +4,6 @@ Type:
 Package-Server: 
 Server-Type: snapshot
 InstallManager-Version: 2.3.0
-Distribution: tizen_2.2
+Distribution: develop
 Release-note: https://developer.tizen.org
 
index 989fce2..eb6b162 100644 (file)
@@ -43,6 +43,7 @@ import org.tizen.installmanager.core.IMFatalException;
 import org.tizen.installmanager.core.InstallManager;
 import org.tizen.installmanager.core.InstallManagerConstants;
 import org.tizen.installmanager.core.Options;
+import org.tizen.installmanager.core.Performance;
 import org.tizen.installmanager.lib.Downloader;
 import org.tizen.installmanager.lib.ErrorController;
 import org.tizen.installmanager.lib.IFileSystemInformation;
@@ -326,11 +327,13 @@ public class CliInstall {
         * @return
         */
        private static boolean initInstallManager() {
+               Performance.setInitializeStartTime();
                ErrorController.setInstallationSuccess(true);
                
                controller = new ViewController();
                
                if (controller.init()) {
+                       Performance.setInitializeEndTime();
                        return true;
                } else {
                        Log.err("InstallManager init fail.");
index 724f031..a59f123 100644 (file)
@@ -34,6 +34,7 @@ import java.util.List;
 
 import org.tizen.installmanager.core.Config;
 import org.tizen.installmanager.core.IMExitException;
+import org.tizen.installmanager.core.Performance;
 import org.tizen.installmanager.lib.Log;
 import org.tizen.installmanager.lib.Platform;
 import org.tizen.installmanager.pkg.lib.PackageManager;
@@ -60,6 +61,7 @@ public class CliUninstall {
                System.out.println("******* Start SDK uninstallation *******");
                System.out.println("****************************************");
                
+               Performance.setRemovalStartTime();
                ViewController controller = new ViewController();
                controller.init();
                
@@ -87,11 +89,13 @@ public class CliUninstall {
                        if (size == 1 && pkg.getPackageName().equals(ESSENTIAL_COMPONENT)) {
                                if (controller.uninstall(pm.getInstalledMetaNames(), null)) {
                                        clearTargetDir();
+                                       Performance.setRemovalEndTime();
                                        return true;
                                } else {
                                        return false;
                                }
                        } else {
+                               Performance.setRemovalEndTime();
                                return true;
                        }
                } else {
index 1ea8739..b9c050a 100644 (file)
@@ -28,9 +28,9 @@ public class Performance {
        private static Date installationStartTime = null;
        private static Date installationEndTime = null;
        
-       //uninstallation time
-       private static Date uninstallStartTime = null;
-       private static Date uninstallEndTime = null;
+       //removal time
+       private static Date removalStartTime = null;
+       private static Date removalEndTime = null;
        
        //information
        public static long sdkPackageSize = 0; 
@@ -68,12 +68,12 @@ public class Performance {
                installationEndTime = new Date();
        }
        
-       public static void setUninstallStartTime() {
-               uninstallStartTime = new Date();
+       public static void setRemovalStartTime() {
+               removalStartTime = new Date();
        }
        
-       public static void setUninstallEndTime() {
-               uninstallEndTime = new Date();
+       public static void setRemovalEndTime() {
+               removalEndTime = new Date();
        }
        
        public static void printToLogFile() {
@@ -119,8 +119,8 @@ public class Performance {
                        out.write("The installation time\t: " + getInstallationTime() + "sec");
                        out.write("(" + getBitPerSecond(sdkPackageSize, getInstallationTime())+ "b/s)");
                        out.newLine();
-                       out.write("The removal time\t: " + getUninstallTime() + "sec");
-                       out.write("(" + getBitPerSecond(sdkPackageSize, getUninstallTime())+ "b/s)");
+                       out.write("The removal time\t: " + getRemovalTime() + "sec");
+                       out.write("(" + getBitPerSecond(sdkPackageSize, getRemovalTime())+ "b/s)");
                        out.newLine();
                        out.write("The install-manager start time\t: " + imStartTime);
                        out.newLine();
@@ -188,12 +188,12 @@ public class Performance {
                return interval;
        }
        
-       private static long getUninstallTime() {
-               if (uninstallStartTime == null || uninstallEndTime == null) {
+       private static long getRemovalTime() {
+               if (removalStartTime == null || removalEndTime == null) {
                        return 0;
                }
                
-               long interval = (uninstallEndTime.getTime() - uninstallStartTime.getTime())/1000;
+               long interval = (removalEndTime.getTime() - removalStartTime.getTime())/1000;
                return interval;
        }
        
index 0ce899a..72ceebe 100644 (file)
@@ -854,6 +854,10 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        Log.log("Fail to command line remove.");
                                        System.out.println("Fail to remove.");
                                }
+                               if (Options.doTest) {
+                                       Performance.printTestResult();
+                               }
+                               
                                System.exit(0);
                        } else if (Options.showVersion) {
                                showInstallManagerVersion();
index 51e41a6..8659c5d 100644 (file)
@@ -391,12 +391,12 @@ public class ViewController {
                Log.log("ViewController Uninstall Start => " + uninstallList);
                
                //performance measurement
-               Performance.setUninstallStartTime();
+               Performance.setRemovalStartTime();
                if (packageManager == null || uninstallList.size() == 0) {
                        Log.err("ViewController.uninstall() uninstalllist does not exist. => " + uninstallList);
                        ErrorController.setError(ErrorCode.UNKNOWN_ERROR);
                        
-                       Performance.setUninstallEndTime();
+                       Performance.setRemovalEndTime();
                        return false;
                }
 
@@ -404,7 +404,7 @@ public class ViewController {
                        uninstallAll(monitor);
                        
                        //performance measurement
-                       Performance.setUninstallEndTime();
+                       Performance.setRemovalEndTime();
                        
                        return true;
                } else {
@@ -416,7 +416,7 @@ public class ViewController {
                        boolean result = uninstallPackages(removablePackages, monitor);
                        
                        //performance measurement
-                       Performance.setUninstallEndTime();
+                       Performance.setRemovalEndTime();
                        return result;
                }
        }
index 814b197..d40aa68 100644 (file)
@@ -1,5 +1,5 @@
 Source: install-manager
-Version: 2.2.40
+Version: 2.2.41
 Maintainer: Shihyun Kim<shihyun.kim@samsung.com>, Yongsung Kim<yongsung1.kim@samsung.com>
 
 Package: install-manager