* Performance measurement workaround when measuring multi-thread events:
Use the Flow Entry ID as part of the measurement point tag.
* Add measurement points when writing a Flow Path to the database,
and when sending Flow Entry notifications because of the modified path.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
index b44a3de..1e3c67f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
@@ -1405,12 +1405,13 @@
@Override
public void notificationRecvFlowEntryAdded(FlowEntry flowEntry) {
if (enableOnrc2014MeasurementsFlows) {
- PerformanceMonitor.start("EventHandler.AddFlowEntryToSwitch");
+ String tag = "EventHandler.AddFlowEntryToSwitch." + flowEntry.flowEntryId();
+ PerformanceMonitor.start(tag);
Collection entries = new ArrayList();
entries.add(flowEntry);
flowManager.pushModifiedFlowEntriesToSwitches(entries);
- PerformanceMonitor.stop("EventHandler.AddFlowEntryToSwitch");
- PerformanceMonitor.report("EventHandler.AddFlowEntryToSwitch");
+ PerformanceMonitor.stop(tag);
+ PerformanceMonitor.report(tag);
return;
}
@@ -1427,7 +1428,8 @@
@Override
public void notificationRecvFlowEntryRemoved(FlowEntry flowEntry) {
if (enableOnrc2014MeasurementsFlows) {
- PerformanceMonitor.start("EventHandler.RemoveFlowEntryFromSwitch");
+ String tag = "EventHandler.RemoveFlowEntryFromSwitch." + flowEntry.flowEntryId();
+ PerformanceMonitor.start(tag);
//
// NOTE: Must update the state to DELETE, because
// the notification contains the original state.
@@ -1437,8 +1439,8 @@
Collection entries = new ArrayList();
entries.add(flowEntry);
flowManager.pushModifiedFlowEntriesToSwitches(entries);
- PerformanceMonitor.stop("EventHandler.RemoveFlowEntryFromSwitch");
- PerformanceMonitor.report("EventHandler.RemoveFlowEntryFromSwitch");
+ PerformanceMonitor.stop(tag);
+ PerformanceMonitor.report(tag);
return;
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/ParallelFlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/ParallelFlowDatabaseOperation.java
index 571c78d..b9a54e7 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/ParallelFlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/ParallelFlowDatabaseOperation.java
@@ -261,7 +261,12 @@
@Override
public Boolean call() throws Exception {
+ String tag1 = "FlowDatabaseOperation.AddFlow." + flowPath.flowId();
+ String tag2 = "FlowDatabaseOperation.NotificationSend.FlowEntry." + flowPath.flowId();
+ PerformanceMonitor.start(tag1);
boolean success = FlowDatabaseOperation.addFlow(dbHandler, flowPath);
+ PerformanceMonitor.stop(tag1);
+ PerformanceMonitor.start(tag2);
if(success) {
if(datagridService != null) {
// Send notifications for each Flow Entry
@@ -293,6 +298,9 @@
else {
log.error("Error adding flow path {} to database", flowPath);
}
+ PerformanceMonitor.stop(tag2);
+ PerformanceMonitor.report(tag1);
+ PerformanceMonitor.report(tag2);
return success;
}