Use PerfMan for FlowPath/FlowEntry measurement
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
index 05c5ecb..b944a01 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -17,6 +17,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.tinkerpop.blueprints.impls.ramcloud.PerfMon;
+
/**
* Class for performing Flow-related operations on the Database.
*/
@@ -50,7 +52,9 @@
long accTimeAddFlowEntries = 0;
int numNewFlowEntries = 0;
LinkedList<long[]> flowEntryTimes = new LinkedList<>();
+ PerfMon pm = PerfMon.getInstance();
+ pm.addflowpath_start();
try {
if ( measureONOSFlowTimeProp ) {
startAddFlow = System.nanoTime();
@@ -260,6 +264,7 @@
if ( measureONOSFlowTimeProp ) {
endSettingFlowPathProps = System.nanoTime();
}
+ pm.addflowpath_end();
// Flow edges:
// HeadFE
@@ -268,10 +273,13 @@
// Flow Entries:
// flowPath.dataPath().flowEntries()
//
+ pm.addflowentry_start();
for (FlowEntry flowEntry : flowPath.dataPath().flowEntries()) {
if (flowEntry.flowEntryUserState() == FlowEntryUserState.FE_USER_DELETE)
continue; // Skip: all Flow Entries were deleted earlier
+ pm.addflowentry_incr();
+
long startAddFlowEntry = 0, endAddFlowEntry;
if( measureONOSFlowTimeProp ) {
startAddFlowEntry = System.nanoTime();
@@ -288,6 +296,7 @@
return false;
}
}
+ pm.addflowentry_end();
dbHandler.commit();