Commit c00c4b80 authored by Rita Sousa's avatar Rita Sousa

Cleaned code

parent 696caebe
......@@ -63,10 +63,10 @@ public class DataclayWritingManager implements Runnable{
Map<String, String> idContainers = getContainersId(workersIpAndIdContainer);
for( String ipAddress : workersIpAndIdContainer.keySet()){
/*for( String ipAddress : workersIpAndIdContainer.keySet()){
System.out.println("ipAddress="+ipAddress);
System.out.println("idContainer="+workersIpAndIdContainer.get(ipAddress));
}
}*/
for (Worker w : workerList) {
if (w.isActive()){
......@@ -214,9 +214,9 @@ public class DataclayWritingManager implements Runnable{
if(used_memory != -1 && available_memory != -1){
memUsagePerc = ((float) used_memory / available_memory) * 100;
System.out.println("-----------");
/*System.out.println("-----------");
System.out.printf("%.3f\n",memUsagePerc);
System.out.println("-----------");
System.out.println("-----------");*/
}
long cpu_delta = -1, system_cpu_delta = -1;
......@@ -243,16 +243,17 @@ public class DataclayWritingManager implements Runnable{
//System.out.println(system_cpu_delta);
//System.out.println(number_cpus);
cpuUsagePerc = ( (float) cpu_delta / system_cpu_delta) * number_cpus * 100;
System.out.println("-----------");
/*System.out.println("-----------");
System.out.printf("%.3f\n",cpuUsagePerc);
System.out.println("-----------");
System.out.println("-----------");*/
}
if(cpuUsagePerc > 0.0f){
w.setCpuUsage(cpuUsagePerc);
System.out.println("-----------");
System.out.printf("Resource consumption %.3f written on dataClay\n", w.getCpuUsage());
/*System.out.println("-----------");
System.out.printf("VALUE FROM DATACLAY %.3f\n", w.getCpuUsage());
System.out.println("-----------");
System.out.println("-----------");*/
}
......
......@@ -42,7 +42,7 @@ public class EnergyMonitor implements Runnable {
subscriber.setCallback( new MqttCallBack("energy",rm) );
subscriber.connect();
// TODO: Get right topic for energy dimension
String[] topics = new String[] { "power-consumption", "GPU_current","GPU_power" };
String[] topics = new String[] { "power-consumption" };
subscriber.subscribe(topics);
} catch(MqttException e){
......
......@@ -83,7 +83,7 @@ public class ResourceManager {
e.printStackTrace();
}
} else {
System.out.println("Everything is fine...");
System.out.printf("Resource %s is fine...\n", topic);
}
}
......@@ -102,7 +102,7 @@ public class ResourceManager {
e.printStackTrace();
}
} else {
System.out.println("Everything is fine...");
System.out.printf("Resource %s is fine...\n", topic);
}
}
break;
......@@ -111,12 +111,11 @@ public class ResourceManager {
case "power-consumption":
// To update the Node's energyThreshold variable
getNodeEnergyCapacity();
// TODO: Fix metrics
// TODO: Check metrics
break;
default:
break;
}
}
}
Markdown is supported
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