Changes
authorAli Younis <ayounis@uci.edu>
Wed, 17 May 2017 23:04:41 +0000 (16:04 -0700)
committerAli Younis <ayounis@uci.edu>
Wed, 17 May 2017 23:04:41 +0000 (16:04 -0700)
version2/src/java/light_fan_embed_benchmark/Filler.java
version2/src/java/light_fan_embed_benchmark/Sensor.java
version2/src/java/light_fan_embed_benchmark/Setup.java

index 6d553de..e629039 100644 (file)
@@ -9,14 +9,6 @@ class Filler {
         Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 400, -1);
         t1.rebuild(); // update
 
-
-        String a1 = "bulb1";
-        String a2 = "bulb2";
-        String a3 = "bulb3";
-        IoTString ia1 = new IoTString(a1);
-        IoTString ia2 = new IoTString(a2);
-        IoTString ia3 = new IoTString(a3);
-
         String valueA = "on";
         String valueB = "off";
         IoTString iValueA = new IoTString(valueA);
@@ -28,22 +20,19 @@ class Filler {
 
         for (int i = 0; i < 10; i++) {
 
-            t1.update();
-            t1.startTransaction();
-            t1.addKV(ia1, iValueB);
-            t1.commitTransaction();
+
+            String a1 = "bulb" + (i % 100);
+            IoTString ia1 = new IoTString(a1);
 
 
-            t1.update();
-            t1.startTransaction();
-            t1.addKV(ia3, iValueB);
-            t1.commitTransaction();
 
             t1.update();
             t1.startTransaction();
-            t1.addKV(ia2, iValueB);
+            t1.addKV(ia1, iValueB);
             t1.commitTransaction();
 
+
+
         }
     }
 }
\ No newline at end of file
index 3dd3703..a9c9e45 100644 (file)
@@ -24,7 +24,7 @@ class Sensor {
 
         System.out.println("Sleeping......");
 
-         try {
+        try {
             Thread.sleep(10000);
         } catch (Exception e) {
 
@@ -33,9 +33,60 @@ class Sensor {
         System.out.println("Pulling......");
         long stop1 = System.currentTimeMillis();
 
+
+
+
+
         System.out.println(stop1 - pstart);
+        t1.update();
+
+
+
+
+        Runtime runTime = Runtime.getRuntime();
+        // Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp | tr -d 'temp=' |  tr -d \"'C\"");
+        Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp");
+        BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+        String line = null;
+        String dat = "";
+        while ((line = reader.readLine()) != null) {
+            System.out.println(line);
+            dat = line;
+        }
+        reader.close();
+
+
+
+        // String pingTimer = Long.toString(System.currentTimeMillis());
+        // IoTString ipingTimer = new IoTString(pingTimer);
+
+
+
+        String a1 = "bulb1";
+        IoTString ia1 = new IoTString(a1);
+
+
+
+        IoTString senDat = new IoTString(dat);
 
         t1.update();
+        t1.startTransaction();
+        t1.addKV(ia1, senDat);
+        t1.commitTransaction();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
         long stop2 = System.currentTimeMillis();
 
         System.out.println("Done......");
index a9ae0f2..69c651a 100644 (file)
@@ -9,50 +9,58 @@ class Setup {
         t1.initTable();
 
 
-        String a1 = "bulb1";
-        String a2 = "bulb2";
-        String a3 = "bulb3";
-        IoTString ia1 = new IoTString(a1);
-        IoTString ia2 = new IoTString(a2);
-        IoTString ia3 = new IoTString(a3);
+        for ( int i = 0; i < 200; i++) {
+            String a1 = "bulb" + i;
+            IoTString ia1 = new IoTString(a1);
+            t1.createNewKey(ia1, 321);
+            t1.update();
+        }
 
 
+        // String a1 = "bulb1";
+        // String a2 = "bulb2";
+        // String a3 = "bulb3";
+        // IoTString ia1 = new IoTString(a1);
+        // IoTString ia2 = new IoTString(a2);
+        // IoTString ia3 = new IoTString(a3);
 
-        String b1 = "wemo1";
-        String b2 = "wemo2";
-        IoTString ib1 = new IoTString(b1);
-        IoTString ib2 = new IoTString(b2);
 
 
-        String c1 = "sensor";
-        IoTString ic1 = new IoTString(c1);
+        // String b1 = "wemo1";
+        // String b2 = "wemo2";
+        // IoTString ib1 = new IoTString(b1);
+        // IoTString ib2 = new IoTString(b2);
 
 
-        String pingTimerKey = "bulbController";
-        IoTString ipingTimerKey = new IoTString(pingTimerKey);
+        // String c1 = "sensor";
+        // IoTString ic1 = new IoTString(c1);
 
 
-        String pingTimerKey2 = "wemoController";
-        IoTString ipingTimerKey2 = new IoTString(pingTimerKey2);
+        // String pingTimerKey = "bulbController";
+        // IoTString ipingTimerKey = new IoTString(pingTimerKey);
 
 
-        String pingTimerKey3 = "sensorController";
-        IoTString ipingTimerKey3 = new IoTString(pingTimerKey3);
+        // String pingTimerKey2 = "wemoController";
+        // IoTString ipingTimerKey2 = new IoTString(pingTimerKey2);
 
 
-        t1.createNewKey(ia1, 321);
-        t1.createNewKey(ia2, 321);
-        t1.createNewKey(ia3, 321);
-        t1.createNewKey(ipingTimerKey, 321);
+        // String pingTimerKey3 = "sensorController";
+        // IoTString ipingTimerKey3 = new IoTString(pingTimerKey3);
 
-        t1.createNewKey(ib1, 351);
-        t1.createNewKey(ib2, 351);
-        t1.createNewKey(ipingTimerKey2, 351);
 
+        // t1.createNewKey(ia1, 321);
+        // t1.createNewKey(ia2, 321);
+        // t1.createNewKey(ia3, 321);
+        // t1.createNewKey(ipingTimerKey, 321);
 
-        t1.createNewKey(ic1, 361);
-        t1.createNewKey(ipingTimerKey3, 361);
+        // t1.createNewKey(ib1, 351);
+        // t1.createNewKey(ib2, 351);
+        // t1.createNewKey(ipingTimerKey2, 351);
 
-        t1.update();
+
+        // t1.createNewKey(ic1, 361);
+        // t1.createNewKey(ipingTimerKey3, 361);
+
+        // t1.update();
     }
 }
\ No newline at end of file