devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From re...@apache.org
Subject svn commit: r1693611 - in /devicemap/trunk/clients/2.0/reference: src/Main.java test.sh
Date Fri, 31 Jul 2015 14:38:34 GMT
Author: rezan
Date: Fri Jul 31 14:38:33 2015
New Revision: 1693611

URL: http://svn.apache.org/r1693611
Log:
cleanup

Modified:
    devicemap/trunk/clients/2.0/reference/src/Main.java
    devicemap/trunk/clients/2.0/reference/test.sh

Modified: devicemap/trunk/clients/2.0/reference/src/Main.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Main.java?rev=1693611&r1=1693610&r2=1693611&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Main.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Main.java Fri Jul 31 14:38:33 2015
@@ -80,33 +80,7 @@ public class Main {
     //WARMUP
     
     if(warmup > 0) {
-      log("Warmup...", -1);
-
-      int origVerbose = verbose;
-      verbose = -2;
-
-      for(int i = 0; i < warmup; i++) {
-        DeviceMapClient client = new DeviceMapClient();
-
-        for(String pattern : patterns) {
-          client.loadPatterns(new JsonFile(pattern));
-        }
-
-        for(String attribute : attributes) {
-          client.loadAttributes(new JsonFile(attribute));
-        }
-
-        for(String test : tests) {
-          test(client, new JsonFile(test));
-        }
-      }
-
-      System.gc();
-      System.runFinalization();
-
-      verbose = origVerbose;
-
-      log("Warmup completed", -1);
+      runWarmup(warmup, patterns, attributes, tests);
     }
 
     //BUILD THE DEVICEMAP CLIENT
@@ -289,6 +263,36 @@ public class Main {
     return testCount != passCount;
   }
 
+  public static void runWarmup(int iterations, List<String> p, List<String> a,
List<String> t) throws Exception {
+    log("Warmup...", -1);
+
+    int origVerbose = verbose;
+    verbose = -2;
+
+    for(int i = 0; i < iterations; i++) {
+      DeviceMapClient client = new DeviceMapClient();
+
+      for(String pattern : p) {
+        client.loadPatterns(new JsonFile(pattern));
+      }
+
+      for(String attribute : a) {
+        client.loadAttributes(new JsonFile(attribute));
+      }
+
+      for(String test : t) {
+        test(client, new JsonFile(test));
+      }
+    }
+
+    System.gc();
+    System.runFinalization();
+
+    verbose = origVerbose;
+
+    log("Warmup completed", -1);
+  }
+
   public static String getTime(long ns)
   {
       return ns / (1000 * 1000 * 1000) + "s " +

Modified: devicemap/trunk/clients/2.0/reference/test.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/test.sh?rev=1693611&r1=1693610&r2=1693611&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/test.sh (original)
+++ devicemap/trunk/clients/2.0/reference/test.sh Fri Jul 31 14:38:33 2015
@@ -23,6 +23,7 @@ PASS=
 for DOMAIN in $DOMAINS
 do
     DROOT=$ROOT/$DOMAIN
+
     if [ ! -d $DROOT -o "`ls $DROOT | grep pattern`" = "" ]
     then
         continue



Mime
View raw message