Stuff
[iotcloud.git] / version2 / src / java / iotcloud / Test.java
index 99babcbe450b5501fa46e9430f4f1fd432b80f40..403c2beb368b4645ffa3b8418fab02820ce22996 100644 (file)
@@ -11,7 +11,7 @@ import java.util.ArrayList;
 
 public class Test {
 
-    public static final  int NUMBER_OF_TESTS = 15;
+    public static final  int NUMBER_OF_TESTS = 25;
 
     public static void main(String[] args)  throws ServerException {
         if (args[0].equals("2")) {
@@ -34,7 +34,266 @@ public class Test {
             test10();
         } else if (args[0].equals("11")) {
             test11();
+        } else if (args[0].equals("12")) {
+            test12();
+        } else if (args[0].equals("13")) {
+            test13();
         }
+
+        else if (args[0].equals("14")) {
+            test14();
+        }
+    }
+
+
+    static void test14() throws ServerException {
+        TimingSingleton timer = TimingSingleton.getInstance();
+
+        boolean foundError = false;
+        long startTime = 0;
+        long endTime = 0;
+        List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
+
+        // Setup the 2 clients
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+        t1.initTable();
+        System.out.println("T1 Ready");
+
+        // Make the Keys
+        System.out.println("Setting up keys");
+        startTime = System.nanoTime();
+        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+            System.out.println(i);
+            String a = "a" + i;
+            IoTString ia = new IoTString(a);
+            t1.createNewKey(ia, 321);
+        }
+        endTime = System.nanoTime();
+        long keysDt = endTime - startTime;
+        long keysNet = timer.getTime();
+
+        System.out.println("Total Key Create Time: " + keysDt / 1000000);
+        System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
+        System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
+        System.out.println();
+   }
+
+
+    static void test13() throws ServerException {
+        TimingSingleton timer = TimingSingleton.getInstance();
+
+        boolean foundError = false;
+        long startTime = 0;
+        long endTime = 0;
+        List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
+
+        // Setup the 2 clients
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+        t1.initTable();
+        System.out.println("T1 Ready");
+
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
+        t2.update();
+        System.out.println("T2 Ready");
+
+        // Make the Keys
+        System.out.println("Setting up keys");
+        startTime = System.nanoTime();
+        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+            System.out.println(i);
+            String a = "a" + i;
+            String b = "b" + i;
+            String c = "c" + i;
+            String d = "d" + i;
+            IoTString ia = new IoTString(a);
+            IoTString ib = new IoTString(b);
+            IoTString ic = new IoTString(c);
+            IoTString id = new IoTString(d);
+            t1.createNewKey(ia, 351);
+            t1.createNewKey(ib, 351);
+            t2.createNewKey(ic, 321);
+            t2.createNewKey(id, 321);
+        }
+        endTime = System.nanoTime();
+        long keysDt = endTime - startTime;
+        long keysNet = timer.getTime();
+
+        // Do Updates for the keys
+        System.out.println("Setting Key-Values...");
+        startTime = System.nanoTime();
+        for (int t = 0; t < 3; t++) {
+            for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+                System.out.println(i);
+                String keyA = "a" + i;
+                String keyB = "b" + i;
+                String keyC = "c" + i;
+                String keyD = "d" + i;
+                String valueA = "a" + i;
+                String valueB = "b" + i;
+                String valueC = "c" + i;
+                String valueD = "d" + i;
+
+                IoTString iKeyA = new IoTString(keyA);
+                IoTString iKeyB = new IoTString(keyB);
+                IoTString iKeyC = new IoTString(keyC);
+                IoTString iKeyD = new IoTString(keyD);
+                IoTString iValueA = new IoTString(valueA);
+                IoTString iValueB = new IoTString(valueB);
+                IoTString iValueC = new IoTString(valueC);
+                IoTString iValueD = new IoTString(valueD);
+
+
+                t1.startTransaction();
+                t1.addKV(iKeyA, iValueA);
+                transStatusList.add(t1.commitTransaction());
+
+                t1.startTransaction();
+                t1.addKV(iKeyB, iValueB);
+                transStatusList.add(t1.commitTransaction());
+
+                t2.startTransaction();
+                t2.addKV(iKeyC, iValueC);
+                transStatusList.add(t2.commitTransaction());
+
+                t2.startTransaction();
+                t2.addKV(iKeyD, iValueD);
+                transStatusList.add(t2.commitTransaction());
+
+            }
+        }
+        endTime = System.nanoTime();
+        long writesDt = endTime - startTime;
+        long writesNet = timer.getTime() - keysNet;
+
+        System.out.println("Updating Clients...");
+        startTime = System.nanoTime();
+        t1.update();
+        t2.update();
+        endTime = System.nanoTime();
+        long updatesDt = endTime - startTime;
+        long updatesNet = timer.getTime() - keysNet - writesNet;
+
+
+        System.out.println("Total Key Create Time: " + keysDt / 1000000);
+        System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
+        System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
+        System.out.println();
+        System.out.println("Total write Time: " + writesDt / 1000000);
+        System.out.println("Total write Time Network: " + writesNet / 1000000);
+        System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
+        System.out.println();
+        System.out.println("Total updates Time: " + updatesDt / 1000000);
+        System.out.println("Total updates Time Network: " + updatesNet / 1000000);
+        System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
+    }
+
+
+    static void test12() throws ServerException {
+        TimingSingleton timer = TimingSingleton.getInstance();
+
+        boolean foundError = false;
+        long startTime = 0;
+        long endTime = 0;
+        List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
+
+        // Setup the 2 clients
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+        t1.initTable();
+        System.out.println("T1 Ready");
+
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
+        t2.update();
+        System.out.println("T2 Ready");
+
+        // Make the Keys
+        System.out.println("Setting up keys");
+        startTime = System.nanoTime();
+        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+            System.out.println(i);
+            String a = "a" + i;
+            String b = "b" + i;
+            String c = "c" + i;
+            String d = "d" + i;
+            IoTString ia = new IoTString(a);
+            IoTString ib = new IoTString(b);
+            IoTString ic = new IoTString(c);
+            IoTString id = new IoTString(d);
+            t1.createNewKey(ia, 321);
+            t1.createNewKey(ib, 321);
+            t2.createNewKey(ic, 351);
+            t2.createNewKey(id, 351);
+        }
+        endTime = System.nanoTime();
+        long keysDt = endTime - startTime;
+        long keysNet = timer.getTime();
+
+        // Do Updates for the keys
+        System.out.println("Setting Key-Values...");
+        startTime = System.nanoTime();
+        for (int t = 0; t < 3; t++) {
+            for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+                System.out.println(i);
+                String keyA = "a" + i;
+                String keyB = "b" + i;
+                String keyC = "c" + i;
+                String keyD = "d" + i;
+                String valueA = "a" + i;
+                String valueB = "b" + i;
+                String valueC = "c" + i;
+                String valueD = "d" + i;
+
+                IoTString iKeyA = new IoTString(keyA);
+                IoTString iKeyB = new IoTString(keyB);
+                IoTString iKeyC = new IoTString(keyC);
+                IoTString iKeyD = new IoTString(keyD);
+                IoTString iValueA = new IoTString(valueA);
+                IoTString iValueB = new IoTString(valueB);
+                IoTString iValueC = new IoTString(valueC);
+                IoTString iValueD = new IoTString(valueD);
+
+
+                t1.startTransaction();
+                t1.addKV(iKeyA, iValueA);
+                transStatusList.add(t1.commitTransaction());
+
+                t1.startTransaction();
+                t1.addKV(iKeyB, iValueB);
+                transStatusList.add(t1.commitTransaction());
+
+                t2.startTransaction();
+                t2.addKV(iKeyC, iValueC);
+                transStatusList.add(t2.commitTransaction());
+
+                t2.startTransaction();
+                t2.addKV(iKeyD, iValueD);
+                transStatusList.add(t2.commitTransaction());
+
+            }
+        }
+        endTime = System.nanoTime();
+        long writesDt = endTime - startTime;
+        long writesNet = timer.getTime() - keysNet;
+
+        System.out.println("Updating Clients...");
+        startTime = System.nanoTime();
+        t1.update();
+        t2.update();
+        endTime = System.nanoTime();
+        long updatesDt = endTime - startTime;
+        long updatesNet = timer.getTime() - keysNet - writesNet;
+
+
+        System.out.println("Total Key Create Time: " + keysDt / 1000000);
+        System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
+        System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
+        System.out.println();
+        System.out.println("Total write Time: " + writesDt / 1000000);
+        System.out.println("Total write Time Network: " + writesNet / 1000000);
+        System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
+        System.out.println();
+        System.out.println("Total updates Time: " + updatesDt / 1000000);
+        System.out.println("Total updates Time Network: " + updatesNet / 1000000);
+        System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
     }
 
 
@@ -44,7 +303,7 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
 
         System.out.println("Init Table t1s");
 
@@ -57,7 +316,7 @@ public class Test {
 
 
         System.out.println("Update Table t2");
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
         while (t2.update() == false) {}
 
         // Make the Keys
@@ -268,7 +527,7 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
         System.out.println("Init Table t1s");
         while (true) {
             try {
@@ -276,7 +535,7 @@ public class Test {
                 break;
             } catch (Exception e) { }
         }
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
         while (t2.update() == false) {}
 
         t1.addLocalCommunication(351, "127.0.0.1", 6001);
@@ -501,7 +760,7 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
 
         System.out.println("Init Table t1s");
         while (true) {
@@ -513,7 +772,7 @@ public class Test {
 
 
         System.out.println("Update Table t2");
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
         while (t2.update() == false) {}
 
         t1.addLocalCommunication(351, "127.0.0.1", 6001);
@@ -583,8 +842,8 @@ public class Test {
             transStatusList.add(t2.commitTransaction());
         }
 
-        while (t1.updateFromLocal(351) == false) {}
-        while (t2.updateFromLocal(321) == false) {}
+        // while (t1.updateFromLocal(351) == false) {}
+        // while (t2.updateFromLocal(321) == false) {}
 
 
         System.out.println("Updating...");
@@ -649,12 +908,15 @@ public class Test {
     }
 
     static void test8() {
+        TimingSingleton timer = TimingSingleton.getInstance();
+        long startTime = 0;
+        long endTime = 0;
 
         boolean foundError = false;
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
 
         System.out.println("Init Table t1s");
 
@@ -667,7 +929,7 @@ public class Test {
 
 
         System.out.println("Update Table t2");
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
         while (t2.update() == false) {}
 
         t1.addLocalCommunication(351, "127.0.0.1", 6001);
@@ -675,6 +937,7 @@ public class Test {
 
         // Make the Keys
         System.out.println("Setting up keys");
+        startTime = System.nanoTime();
         for (int i = 0; i < NUMBER_OF_TESTS; i++) {
             System.out.println(i);
 
@@ -715,8 +978,13 @@ public class Test {
                 } catch (Exception e) { }
             }
         }
+        endTime = System.nanoTime();
+        long keysDt = endTime - startTime;
+        long keysNet = timer.getTime();
+
 
         // Do Updates for the keys
+        startTime = System.nanoTime();
         System.out.println("Setting Key-Values...");
         for (int i = 0; i < NUMBER_OF_TESTS; i++) {
             System.out.println(i);
@@ -773,113 +1041,134 @@ public class Test {
             t2.addKV(iKeyD, iValueD);
             transStatusList.add(t2.commitTransaction());
         }
+        endTime = System.nanoTime();
+        long writesDt = endTime - startTime;
+        long writesNet = timer.getTime() - keysNet;
+
+
 
         System.out.println("Updating...");
+        startTime = System.nanoTime();
         while (t1.update() == false) {}
         while (t2.update() == false) {}
         while (t1.update() == false) {}
         while (t2.update() == false) {}
+        endTime = System.nanoTime();
+        long updatesDt = endTime - startTime;
+        long updatesNet = timer.getTime() - keysNet - writesNet;
 
-        System.out.println("Checking Key-Values...");
-        for (int i = 0; i < NUMBER_OF_TESTS; i++) {
-
-            String keyA = "a" + i;
-            String keyB = "b" + i;
-            String keyC = "c" + i;
-            String keyD = "d" + i;
-            String valueA = "a" + i;
-            String valueB = "b" + i;
-            String valueC = "c" + i;
-            String valueD = "d" + i;
-
-            IoTString iKeyA = new IoTString(keyA);
-            IoTString iKeyB = new IoTString(keyB);
-            IoTString iKeyC = new IoTString(keyC);
-            IoTString iKeyD = new IoTString(keyD);
-            IoTString iValueA = new IoTString(valueA);
-            IoTString iValueB = new IoTString(valueB);
-            IoTString iValueC = new IoTString(valueC);
-            IoTString iValueD = new IoTString(valueD);
-
-
-            IoTString testValA1 = t1.getCommitted(iKeyA);
-            IoTString testValB1 = t1.getCommitted(iKeyB);
-            IoTString testValC1 = t1.getCommitted(iKeyC);
-            IoTString testValD1 = t1.getCommitted(iKeyD);
 
-            IoTString testValA2 = t2.getCommitted(iKeyA);
-            IoTString testValB2 = t2.getCommitted(iKeyB);
-            IoTString testValC2 = t2.getCommitted(iKeyC);
-            IoTString testValD2 = t2.getCommitted(iKeyD);
-
-            if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
-                System.out.println("Key-Value t1 incorrect: " + keyA + "    " + testValA1);
-                foundError = true;
-            }
-
-            if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
-                System.out.println("Key-Value t1 incorrect: " + keyB + "    " + testValB1);
-                foundError = true;
-            }
-
-            if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
-                System.out.println("Key-Value t1 incorrect: " + keyC + "    " + testValC1);
-                foundError = true;
-            }
-
-            if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
-                System.out.println("Key-Value t1 incorrect: " + keyD + "    " + testValD1);
-                foundError = true;
-            }
-
-
-            if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
-                System.out.println("Key-Value t2 incorrect: " + keyA + "    " + testValA2);
-                foundError = true;
-            }
-
-            if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
-                System.out.println("Key-Value t2 incorrect: " + keyB + "    " + testValB2);
-                foundError = true;
-            }
-
-            if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
-                System.out.println("Key-Value t2 incorrect: " + keyC + "    " + testValC2);
-                foundError = true;
-            }
-
-            if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
-                System.out.println("Key-Value t2 incorrect: " + keyD + "    " + testValD2);
-                foundError = true;
-            }
-        }
-
-        int count = 0;
-        for (TransactionStatus status : transStatusList) {
-            if (status.getStatus() != TransactionStatus.StatusCommitted) {
-                foundError = true;
-                System.out.println("Status: " + status.getStatus() + "   " + status.getTransactionSequenceNumber());
-            }
-
-            count++;
-        }
-
-        if (foundError) {
-            System.out.println("Found Errors...");
-        } else {
-            System.out.println("No Errors Found...");
-        }
+        System.out.println("Total Key Create Time: " + keysDt / 1000000);
+        System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
+        System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
+        System.out.println();
+        System.out.println("Total write Time: " + writesDt / 1000000);
+        System.out.println("Total write Time Network: " + writesNet / 1000000);
+        System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
+        System.out.println();
+        System.out.println("Total updates Time: " + updatesDt / 1000000);
+        System.out.println("Total updates Time Network: " + updatesNet / 1000000);
+        System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
+
+
+
+
+        // System.out.println("Checking Key-Values...");
+        // for (int i = 0; i < NUMBER_OF_TESTS; i++) {
+
+        //     String keyA = "a" + i;
+        //     String keyB = "b" + i;
+        //     String keyC = "c" + i;
+        //     String keyD = "d" + i;
+        //     String valueA = "a" + i;
+        //     String valueB = "b" + i;
+        //     String valueC = "c" + i;
+        //     String valueD = "d" + i;
+
+        //     IoTString iKeyA = new IoTString(keyA);
+        //     IoTString iKeyB = new IoTString(keyB);
+        //     IoTString iKeyC = new IoTString(keyC);
+        //     IoTString iKeyD = new IoTString(keyD);
+        //     IoTString iValueA = new IoTString(valueA);
+        //     IoTString iValueB = new IoTString(valueB);
+        //     IoTString iValueC = new IoTString(valueC);
+        //     IoTString iValueD = new IoTString(valueD);
+
+
+        //     IoTString testValA1 = t1.getCommitted(iKeyA);
+        //     IoTString testValB1 = t1.getCommitted(iKeyB);
+        //     IoTString testValC1 = t1.getCommitted(iKeyC);
+        //     IoTString testValD1 = t1.getCommitted(iKeyD);
+
+        //     IoTString testValA2 = t2.getCommitted(iKeyA);
+        //     IoTString testValB2 = t2.getCommitted(iKeyB);
+        //     IoTString testValC2 = t2.getCommitted(iKeyC);
+        //     IoTString testValD2 = t2.getCommitted(iKeyD);
+
+        //     if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
+        //         System.out.println("Key-Value t1 incorrect: " + keyA + "    " + testValA1);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
+        //         System.out.println("Key-Value t1 incorrect: " + keyB + "    " + testValB1);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
+        //         System.out.println("Key-Value t1 incorrect: " + keyC + "    " + testValC1);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
+        //         System.out.println("Key-Value t1 incorrect: " + keyD + "    " + testValD1);
+        //         foundError = true;
+        //     }
+
+
+        //     if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
+        //         System.out.println("Key-Value t2 incorrect: " + keyA + "    " + testValA2);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
+        //         System.out.println("Key-Value t2 incorrect: " + keyB + "    " + testValB2);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
+        //         System.out.println("Key-Value t2 incorrect: " + keyC + "    " + testValC2);
+        //         foundError = true;
+        //     }
+
+        //     if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
+        //         System.out.println("Key-Value t2 incorrect: " + keyD + "    " + testValD2);
+        //         foundError = true;
+        //     }
+        // }
+
+        // for (TransactionStatus status : transStatusList) {
+        //     if (status.getStatus() != TransactionStatus.StatusCommitted) {
+        //         foundError = true;
+        //     }
+        // }
+
+        // if (foundError) {
+        //     System.out.println("Found Errors...");
+        // } else {
+        //     System.out.println("No Errors Found...");
+        // }
 
         t1.close();
         t2.close();
 
-        System.out.println();
-        System.out.println();
-        t1.printSlots();
+        // System.out.println();
+        // System.out.println();
+        // t1.printSlots();
 
-        System.out.println();
-        System.out.println();
-        t2.printSlots();
+        // System.out.println();
+        // System.out.println();
+        // t2.printSlots();
     }
 
     static void test7() throws ServerException {
@@ -888,9 +1177,9 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
 
         // Make the Keys
@@ -1104,9 +1393,9 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
 
         // Make the Keys
@@ -1265,9 +1554,9 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
 
 
@@ -1482,9 +1771,9 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
 
         // Make the Keys
@@ -1657,9 +1946,9 @@ public class Test {
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
 
 
@@ -1835,24 +2124,22 @@ public class Test {
     }
 
     static void test2() throws ServerException {
+        TimingSingleton timer = TimingSingleton.getInstance();
 
         boolean foundError = false;
-        long startTime = 0;
-        long endTime = 0;
         List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
 
         // Setup the 2 clients
-        Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
         t1.initTable();
         System.out.println("T1 Ready");
 
-        Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1);
+        Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
         t2.update();
         System.out.println("T2 Ready");
 
         // Make the Keys
         System.out.println("Setting up keys");
-        startTime = System.currentTimeMillis();
         for (int i = 0; i < NUMBER_OF_TESTS; i++) {
             System.out.println(i);
             String a = "a" + i;
@@ -1868,14 +2155,9 @@ public class Test {
             t2.createNewKey(ic, 321);
             t2.createNewKey(id, 351);
         }
-        endTime = System.currentTimeMillis();
-        System.out.println("Time Taken: " + (double)   ((endTime - startTime) / 1000.0)    );
-        System.out.println("Time Taken Per Key: " + (double)  (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4))   );
-        System.out.println();
 
         // Do Updates for the keys
         System.out.println("Setting Key-Values...");
-        startTime = System.currentTimeMillis();
         for (int i = 0; i < NUMBER_OF_TESTS; i++) {
             System.out.println(i);
             String keyA = "a" + i;
@@ -1900,8 +2182,6 @@ public class Test {
             t1.startTransaction();
             t1.addKV(iKeyA, iValueA);
             transStatusList.add(t1.commitTransaction());
-
-
             t1.startTransaction();
             t1.addKV(iKeyB, iValueB);
             transStatusList.add(t1.commitTransaction());
@@ -1915,17 +2195,14 @@ public class Test {
             transStatusList.add(t2.commitTransaction());
 
         }
-        endTime = System.currentTimeMillis();
-        System.out.println("Time Taken: " + (double)   ((endTime - startTime) / 1000.0)    );
-        System.out.println("Time Taken Per Update: " + (double)  (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4))   );
-        System.out.println();
-
 
         System.out.println("Updating Clients...");
         t1.update();
         t2.update();
 
 
+
+
         System.out.println("Checking Key-Values...");
         for (int i = 0; i < NUMBER_OF_TESTS; i++) {