Commit 81cd4ccc authored by Rita Sousa's avatar Rita Sousa

Added more fake workers

parent 15065bab
......@@ -157,7 +157,7 @@ public class NFRTool {
}
public static void addWorkersToSystem(ElasticSystem system, String localIP) {
int pid1 = 0, pid2 = 0, pid3 = 0;// , pid4 = 0;
int pid1 = 0, pid2 = 0, pid3 = 0, pid4 = 0, pid5 = 0, pid6 = 0;
// Execute fake workers to monitor
try {
......@@ -174,6 +174,12 @@ public class NFRTool {
// Process p4 = Runtime.getRuntime().exec("fake_worker/fakeworker4");
// pid4 = (int) p4.pid();
// Process p5 = Runtime.getRuntime().exec("fake_worker/fakeworker5");
// pid5 = (int) getPidOfProcess(p5);
// Process p6 = Runtime.getRuntime().exec("fake_worker/fakeworker6");
// pid6 = (int) getPidOfProcess(p6);
} catch (Exception e) {
e.printStackTrace();
}
......@@ -190,20 +196,28 @@ public class NFRTool {
float cpuUsage = 0.0f, energyUsage = 0.0f, communicationCost = 0.0f;
int computingUnits = Runtime.getRuntime().availableProcessors();
String ip = localIP;
List<String> deactivationReason = new ArrayList<>();
deactivationReason.add("");
Worker worker1 = new Worker(node, pid1, true, app, cpuUsage, energyUsage, computingUnits, ip,
communicationCost);
communicationCost, deactivationReason);
Worker worker2 = new Worker(node, pid2, true, app, cpuUsage, energyUsage, computingUnits, ip,
communicationCost);
communicationCost, deactivationReason);
Worker worker3 = new Worker(node, pid3, true, app, cpuUsage, energyUsage, computingUnits, ip,
communicationCost);
// Worker worker4 = new Worker(node, pid4, true, app, cpuUsage, energyUsage,
// computingUnits, ip, communicationCost);
communicationCost, deactivationReason);
// Worker worker4 = new Worker(node, pid4, true, app, cpuUsage, energyUsage, computingUnits, ip,
// communicationCost, deactivationReason);
// Worker worker5 = new Worker(node, pid5, true, app, cpuUsage, energyUsage, computingUnits, ip,
// communicationCost, deactivationReason);
// Worker worker6 = new Worker(node, pid6, true, app, cpuUsage, energyUsage, computingUnits, ip,
// communicationCost, deactivationReason);
// Add worker to application
app.addWorker(worker1);
app.addWorker(worker2);
app.addWorker(worker3);
// app.addWorker(worker4);
//app.addWorker(worker4);
//app.addWorker(worker5);
//app.addWorker(worker6);
}
public static void getCurrentElasticSystem(ElasticSystem system) {
......
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