Skip to content
Snippets Groups Projects
Commit 63b9e523 authored by NTUMBA WA NTUMBA Patient's avatar NTUMBA WA NTUMBA Patient
Browse files

Update IP and BC

parent 0636dc39
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,7 @@ public class MeasureAgent { ...@@ -52,6 +52,7 @@ public class MeasureAgent {
// Registry port for rmi communication // Registry port for rmi communication
LocateRegistry.createRegistry(port); LocateRegistry.createRegistry(port);
System.setProperty("java.rmi.server.hostname",address);
// Creating and starting MRI connector // Creating and starting MRI connector
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + address + ":" + port + "/server"); JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + address + ":" + port + "/server");
...@@ -82,6 +83,7 @@ public class MeasureAgent { ...@@ -82,6 +83,7 @@ public class MeasureAgent {
} }
count++; count++;
} }
// Compute mediane timestamp value // Compute mediane timestamp value
Arrays.sort(deltaTimestampCollection); Arrays.sort(deltaTimestampCollection);
......
...@@ -24,12 +24,12 @@ public class MonitorMain { ...@@ -24,12 +24,12 @@ public class MonitorMain {
MeasureListener listener_0 = new MeasureListener("timestamp_1", "128.93.65.234", "9000"); MeasureListener listener_0 = new MeasureListener("timestamp_1", "128.93.65.234", "9000");
MeasureListener listener_1 = new MeasureListener("timestamp_2", "128.93.64.132", "9001"); MeasureListener listener_1 = new MeasureListener("timestamp_2", "128.93.65.233", "9001");
MeasureListener listener_2 = new MeasureListener("timestamp_3", "128.93.64.132", "9002"); MeasureListener listener_2 = new MeasureListener("timestamp_3", "128.93.65.233", "9002");
MeasureListener listener_3 = new MeasureListener("timestamp_4", "128.93.65.233", "9003"); MeasureListener listener_3 = new MeasureListener("timestamp_4", "128.93.64.132", "9003");
MeasureListener listener_4 = new MeasureListener("timestamp_5", "128.93.65.233", "9004"); MeasureListener listener_4 = new MeasureListener("timestamp_5", "128.93.64.132", "9004");
MeasureListener listener_5 = new MeasureListener("timestamp_6", "128.93.64.90", "9005");
ExperimentListener experimentListener = new ExperimentListener("StartExperiment", "128.93.65.234", "9006"); ExperimentListener experimentListener = new ExperimentListener("StartExperiment", "128.93.65.234", "9006");
MeasureListener listener_5 = new MeasureListener("timestamp_6", "128.93.64.90", "9005");
int style = DateFormat.MEDIUM; int style = DateFormat.MEDIUM;
DateFormat df = DateFormat.getDateInstance(style, Locale.US); DateFormat df = DateFormat.getDateInstance(style, Locale.US);
...@@ -43,7 +43,7 @@ public class MonitorMain { ...@@ -43,7 +43,7 @@ public class MonitorMain {
listener_5.connect(); listener_5.connect();
experimentListener.connect(); experimentListener.connect();
try { try{
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -83,76 +83,78 @@ public class MonitorMain { ...@@ -83,76 +83,78 @@ public class MonitorMain {
// t1)\t\t(t4 - t3)\t\t(t5 - t0)\n"); // t1)\t\t(t4 - t3)\t\t(t5 - t0)\n");
MongoClient mongoClient = new MongoClient(new MongoClientURI("mongodb://localhost:27017")); // MongoClient mongoClient = new MongoClient(new MongoClientURI("mongodb://localhost:27017"));
DB database = mongoClient.getDB("experiments"); // DB database = mongoClient.getDB("experiments");
DBCollection collection = database.getCollection("exp_websocket_rest_mqtt_05042017_585_100_distributed"); // DBCollection collection = database.getCollection("exp_websocket_rest_mqtt_05042017_585_100_distributed");
Date start = new Date(experimentListener.experimentStartTime); Date start = new Date(experimentListener.experimentStartTime);
Date complete = new Date(experimentListener.experimentCompleteTime); Date complete = new Date(experimentListener.experimentCompleteTime);
for (int i = 0; i < experimentMsgSent; i++) {
t0 = 0;
t1 = 0;
t2 = 0;
t3 = 0;
t4 = 0;
t5 = 0;
if (listener_0.getContainer().get(i) != null) {
t0 = listener_0.getContainer().get(i);
}
if (listener_1.getContainer().get(i) != null) {
t1 = listener_1.getContainer().get(i);
}
if (listener_1.getContainer().get(i) != null) {
t1 = listener_1.getContainer().get(i);
}
if (listener_2.getContainer().get(i) != null) {
t2 = listener_2.getContainer().get(i);
}
if (listener_3.getContainer().get(i) != null) {
t3 = listener_3.getContainer().get(i);
}
if (listener_4.getContainer().get(i) != null) {
t4 = listener_4.getContainer().get(i);
}
if (listener_5.getContainer().get(i) != null) {
t5 = listener_5.getContainer().get(i);
}
// DBObject doc = new BasicDBObject().append("timestamp_0", t0).append("timestamp_1", t1)
// .append("timestamp_2", t2).append("timestamp_3", t3).append("timestamp_4", t4)
// .append("timestamp_5", t5).append("latency_bc_1", (t2 - t1)).append("latency_bc_2", (t4 - t3))
// .append("latency_end_to_end", (t5 - t0));
// collection.insert(doc);
// System.out.print(t0+"\t"+t1+"\t"+(t1 - t0)+"\n");
System.out.print(t0 + "\t" + t1 + "\t" + t2 + "\t" + t3 + "\t" + t4 + "\t" + t5 + "\t" + (t2 - t1) + "\t"
+ (t4 - t3) + "\t" + (t5 - t0) + "\n");
//
//
}
System.out.println("\n=========================================================== "); System.out.println("\n=========================================================== ");
System.out.println("Start time: " +df.format(start) ); System.out.println("Start time: " +start );
System.out.println("Complete time: " +df.format(complete) ); System.out.println("Complete time: " +complete );
System.out.println("Messages sent: " + experimentMsgSent ); System.out.println("Messages sent: " + experimentMsgSent );
System.out.println("Messages receive: " + experimentMsgReceive); System.out.println("Messages receive: " + experimentMsgReceive);
System.out.println("Messages lost: " + (experimentListener.experimentMsgCounter - experimentMsgReceive) ); System.out.println("Messages lost: " + (experimentListener.experimentMsgCounter - experimentMsgReceive) );
System.out.println("Avg of messages sent: " + experimentListener.experimentAvgMessagesSent ); System.out.println("Avg of messages sent: " + experimentListener.experimentAvgMessagesSent );
System.out.println("=========================================================== \n"); System.out.println("=========================================================== \n");
// for (int i = 0; i < experimentMsgSent; i++) {
//
// t0 = 0;
// t1 = 0;
// t2 = 0;
// t3 = 0;
// t4 = 0;
// t5 = 0;
//
// if (listener_0.getContainer().get(i) != null) {
//
// t0 = listener_0.getContainer().get(i);
// }
//
// if (listener_1.getContainer().get(i) != null) {
//
// t1 = listener_1.getContainer().get(i);
// }
//
// if (listener_1.getContainer().get(i) != null) {
//
// t1 = listener_1.getContainer().get(i);
// }
//
// if (listener_2.getContainer().get(i) != null) {
//
// t2 = listener_2.getContainer().get(i);
// }
//
// if (listener_3.getContainer().get(i) != null) {
//
// t3 = listener_3.getContainer().get(i);
// }
//
// if (listener_4.getContainer().get(i) != null) {
//
// t4 = listener_4.getContainer().get(i);
// }
//
// if (listener_5.getContainer().get(i) != null) {
//
// t5 = listener_5.getContainer().get(i);
// }
//
//// DBObject doc = new BasicDBObject().append("timestamp_0", t0).append("timestamp_1", t1)
//// .append("timestamp_2", t2).append("timestamp_3", t3).append("timestamp_4", t4)
//// .append("timestamp_5", t5).append("latency_bc_1", (t2 - t1)).append("latency_bc_2", (t4 - t3))
//// .append("latency_end_to_end", (t5 - t0));
//// collection.insert(doc);
//
// // System.out.print(t0+"\t"+t1+"\t"+(t1 - t0)+"\n");
// System.out.print(t0 + "\t" + t1 + "\t" + t2 + "\t" + t3 + "\t" + t4 + "\t" + t5 + "\t" + (t2 - t1) + "\t"
// + (t4 - t3) + "\t" + (t5 - t0) + "\n");
// //
// //
// }
} }
......
...@@ -13,7 +13,7 @@ import eu.chorevolution.vsb.agent.MeasureAgent; ...@@ -13,7 +13,7 @@ import eu.chorevolution.vsb.agent.MeasureAgent;
public class MqttCallBack implements MqttCallback { public class MqttCallBack implements MqttCallback {
private MeasureAgent agent = new MeasureAgent("timestamp_6",System.currentTimeMillis(),"localhost",9005); private MeasureAgent agent = new MeasureAgent("timestamp_6",System.currentTimeMillis(),"128.93.64.90",9005);
private int countMessage = 0; private int countMessage = 0;
public void connectionLost(Throwable throwable) { public void connectionLost(Throwable throwable) {
......
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment