adding measurement logs to Plan(Calc|Install)Runtime
Change-Id: I856555a8bcbb28649e9341fd3ebe2b733faba5e2
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java b/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
index 4a5ca37..b12711a 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
@@ -39,8 +39,14 @@
}
public List<Set<FlowEntry>> computePlan(IntentOperationList intentOps) {
+ long start = System.nanoTime();
Set<Collection<FlowEntry>> flowEntries = computeFlowEntries(intentOps);
- return buildPhases(flowEntries);
+ long step1 = System.nanoTime();
+ List<Set<FlowEntry>> plan = buildPhases(flowEntries);
+ long step2 = System.nanoTime();
+ log.error("MEASUREMENT: Compute flow entries: {} ns, Build phases: {} ns",
+ (step1 - start), (step2 - step1));
+ return plan;
}
private Set<Collection<FlowEntry>> computeFlowEntries(IntentOperationList intentOps) {
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
index 844e620..a524875 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
@@ -36,6 +36,7 @@
}
public boolean installPlan(List<Set<FlowEntry>> plan) {
+ long start = System.nanoTime();
Map<Long,IOFSwitch> switches = provider.getSwitches();
log.debug("IOFSwitches: {}", switches);
for(Set<FlowEntry> phase : plan) {
@@ -61,6 +62,8 @@
// TODO: insert a barrier after each phase on each modifiedSwitch
// TODO: wait for confirmation messages before proceeding
}
+ long end = System.nanoTime();
+ log.error("MEASUREMENT: Install plan: {} ns", (end-start));
// TODO: we assume that the plan installation succeeds for now
return true;
}