Commit 081a0e5d authored by Rita Sousa's avatar Rita Sousa
Browse files

Fixed small changes

parent 833930f0
......@@ -7,7 +7,7 @@
</Console>
</Appenders>
<Loggers>
<!-- <Logger name="app.Monitor" level="trace" additivity="false">
<Logger name="app.Monitor" level="trace" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="app.DataclayWritingManager" level="trace" additivity="false">
......@@ -15,7 +15,7 @@
</Logger>
<Logger name="app.Utils" level="trace" additivity="false">
<AppenderRef ref="Console"/>
</Logger> -->
</Logger>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
......
......@@ -61,12 +61,12 @@ public class DataclayWritingManager implements Runnable {
atLeastOneActive = true;
String ipAddress = w.getIp();
if (ipAddress.isEmpty()) {
logger.error("Worker with PID {} has IP address empty!!!\n", w.getPid());
logger.error("Worker with PID {} has IP address empty!!!", w.getPid());
continue;
}
JSONObject metrics = Utils.getWorkerMetrics(ipAddress);
if (metrics == null || metrics.isEmpty()) {
logger.error("Worker with PID {} is a static Worker [Comms demo purposes]\n", w.getPid());
logger.error("Worker with PID {} is a static Worker ?Comms demo purposes?", w.getPid());
continue;
}
insertTimeMetrics(w, metrics);
......@@ -80,10 +80,10 @@ public class DataclayWritingManager implements Runnable {
try {
if (!atLeastOneActive) {
logger.info("No active Workers for now...");
atLeastOneActive = false;
}
// TODO: Monitoring Period should be by COMPSsApp
int monitoringPeriod = 5000;
atLeastOneActive = false;
Thread.sleep(monitoringPeriod);
} catch (InterruptedException e) {
logger.error("{} was interrupted. Aborting...", threadName);
......@@ -148,7 +148,7 @@ public class DataclayWritingManager implements Runnable {
if (cpuUsagePerc > 0.0f) {
w.setCpuUsage(cpuUsagePerc);
logger.printf(Level.INFO, "CPU consumption %.3f of Worker %d written on dataClay\n", w.getCpuUsage(),
logger.printf(Level.INFO, "CPU consumption %.3f of Worker %d written on dataClay", w.getCpuUsage(),
w.getPid());
}
......@@ -158,7 +158,7 @@ public class DataclayWritingManager implements Runnable {
float cpuUsage = w.getCpuUsage() / 100;
float totalEnergy = Utils.getTotalEnergy();
w.setEnergyUsage(cpuUsage * totalEnergy);
logger.printf(Level.INFO, "Energy consumption %.3f of Worker %d written on dataClay\n", w.getEnergyUsage(),
logger.printf(Level.INFO, "Energy consumption %.3f of Worker %d written on dataClay", w.getEnergyUsage(),
w.getPid());
}
......
......@@ -94,7 +94,7 @@ public class Monitor implements Runnable {
Thread.sleep(monitoringPeriod);
} catch (IOException e) {
logger.error("Couldn't get information about status (online/offline) of Nuvlabox with hostname={}!!!\n",
logger.error("Couldn't get information about status (online/offline) of Nuvlabox with hostname={}!!!",
user_hostname);
e.printStackTrace();
} catch (InterruptedException e) {
......
......@@ -172,7 +172,7 @@ public class NFRTool {
Utils.getCurrentElasticSystem(system);
List<Worker> workerList = Utils.getWorkersToMonitor(node, localIP);
logger.info("Workers running locally (Node with IP address {}):\n", node.getIpEth());
logger.info("Workers running locally (Node with IP address {}):", node.getIpEth());
workerList.forEach(worker -> logger.info("Worker: PID={} IP address={} state={}", worker.getPid(),
worker.getIp(), (worker.isActive() ? "active" : "inactive")));
......
......@@ -117,14 +117,14 @@ public class Utils {
continue;
}
ipIdContainers.put(ipAddressContainer, idContainer);
logger.debug("Updating IP address: {} -> {}\n", w.getIp(), ipAddressContainer);
logger.debug("Updating IP address: {} -> {}", w.getIp(), ipAddressContainer);
w.setIp(ipAddressContainer);
int pidContainer = getPidContainer(infoContainer);
if (pidContainer == -1) {
logger.error("Failed getting {} container's PID!!!", idContainer);
}
logger.debug("Updating PID: {} -> {}\n", w.getPid(), pidContainer);
logger.debug("Updating PID: {} -> {}", w.getPid(), pidContainer);
w.setPid(pidContainer);
}
......@@ -231,7 +231,7 @@ public class Utils {
return pid;
}
/**
*
* @param w
......@@ -267,14 +267,14 @@ public class Utils {
logger.error("Failed getting {} container's IP address!!!", idContainer);
}
ipIdContainers.put(ipAddressContainer, idContainer);
logger.debug("Updating IP address: {} -> {}\n", w.getIp(), ipAddressContainer);
logger.debug("Updating IP address: {} -> {}", w.getIp(), ipAddressContainer);
w.setIp(ipAddressContainer);
int pidContainer = getPidContainer(infoContainer);
if (pidContainer == -1) {
logger.error("Failed getting {} container's PID!!!", idContainer);
}
logger.debug("Updating PID: {} -> {}\n", w.getPid(), pidContainer);
logger.debug("Updating PID: {} -> {}", w.getPid(), pidContainer);
w.setPid(pidContainer);
}
......
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