Commit d723265e authored by Kyriakos Kritikos's avatar Kyriakos Kritikos
Browse files

small changes to MC

parent e9e5cf66
...@@ -238,6 +238,7 @@ public class MetricCollector implements MetricCollection{ ...@@ -238,6 +238,7 @@ public class MetricCollector implements MetricCollection{
String modeStr = props.getProperty("mode"); String modeStr = props.getProperty("mode");
if (modeStr == null || modeStr.equals("local")) mode = Mode.LOCAL; if (modeStr == null || modeStr.equals("local")) mode = Mode.LOCAL;
else if (modeStr.equals("global")) mode = Mode.GLOBAL; else if (modeStr.equals("global")) mode = Mode.GLOBAL;
System.out.println("Mode is: " + mode);
String pubStr = props.getProperty("runServer"); String pubStr = props.getProperty("runServer");
if (pubStr == null || pubStr.equals("false")) runServer = false; if (pubStr == null || pubStr.equals("false")) runServer = false;
else if (pubStr.equals("true")) runServer = true; else if (pubStr.equals("true")) runServer = true;
......
...@@ -110,7 +110,8 @@ public class MetricHandler implements Runnable{ ...@@ -110,7 +110,8 @@ public class MetricHandler implements Runnable{
else{ else{
Thread.currentThread().setPriority(Thread.MIN_PRIORITY); Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
} }
MetricStorageWithBlockingQueue.storeMeasurement(value,ID,ecID,measurementType,object,object2); //MetricStorageWithBlockingQueue.storeMeasurement(value,ID,ecID,measurementType,object,object2);
MetricStorage.storeMeasurement(value,ID,ecID,measurementType,object,object2);
pw.println("" + value); pw.println("" + value);
pw.flush(); pw.flush();
} }
......
...@@ -536,6 +536,7 @@ public class Test { ...@@ -536,6 +536,7 @@ public class Test {
idArray2[i] = (CDOID)array2[i]; idArray2[i] = (CDOID)array2[i];
System.out.println("Second array gets: " + idArray2[i]); System.out.println("Second array gets: " + idArray2[i]);
} }
//mc1 = new MetricCollector("/home/kyriakos/Desktop/collector-test");
mc1 = new MetricCollector("/home/kyriakos/Desktop/collector-test"); mc1 = new MetricCollector("/home/kyriakos/Desktop/collector-test");
mc1.readMetrics(idArray, ecID); mc1.readMetrics(idArray, ecID);
try{ try{
...@@ -665,10 +666,10 @@ public class Test { ...@@ -665,10 +666,10 @@ public class Test {
* (a) comment next line code and (b) uncomment the last * (a) comment next line code and (b) uncomment the last
* commented lines of code * commented lines of code
*/ */
runExcessiveTest(ids.iterator().next()); //runExcessiveTest(ids.iterator().next());
//ExecutorService lis = Executors.newFixedThreadPool(3); //ExecutorService lis = Executors.newFixedThreadPool(3);
//startCDOListeners("test",lis); //startCDOListeners("test",lis);
/*ExecutorService thr = Executors.newFixedThreadPool(2); ExecutorService thr = Executors.newFixedThreadPool(2);
startRawMetricThreads("test", thr); startRawMetricThreads("test", thr);
ExecutorService subscribers = Executors.newFixedThreadPool(3); ExecutorService subscribers = Executors.newFixedThreadPool(3);
startSubscribers("test", subscribers); startSubscribers("test", subscribers);
...@@ -691,6 +692,6 @@ public class Test { ...@@ -691,6 +692,6 @@ public class Test {
thr.shutdownNow(); thr.shutdownNow();
subscribers.shutdown(); subscribers.shutdown();
mc1.terminate(); mc1.terminate();
mc2.terminate();*/ mc2.terminate();
} }
} }
...@@ -18,6 +18,7 @@ public class TimeThread extends Thread{ ...@@ -18,6 +18,7 @@ public class TimeThread extends Thread{
public void run() { public void run() {
try{ try{
Thread.sleep(deadline); Thread.sleep(deadline);
System.out.println("Will now commit transaction");
MetricStorage.commitTransaction(true); MetricStorage.commitTransaction(true);
} }
catch(Exception e){ catch(Exception e){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment