Simplified onos-wipe-out shell tool
Added instrumentation to FlowObjectiveManager to confirm/deny time-cost of pipeliner setup.
Change-Id: I93bcd786b0a7cb2b953a23c51f82a20d915d8d1a
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
index 7cbc67f..61f3552 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
@@ -282,9 +282,11 @@
switch (event.type()) {
case MASTER_CHANGED:
log.debug("mastership changed on device {}", event.subject());
+ long start = startWatch();
if (deviceService.isAvailable(event.subject())) {
setupPipelineHandler(event.subject());
}
+ stopWatch(start);
break;
case BACKUPS_CHANGED:
break;
@@ -303,10 +305,12 @@
case DEVICE_AVAILABILITY_CHANGED:
log.debug("Device either added or availability changed {}",
event.subject().id());
+ long start = startWatch();
if (deviceService.isAvailable(event.subject().id())) {
log.debug("Device is now available {}", event.subject().id());
setupPipelineHandler(event.subject().id());
}
+ stopWatch(start);
break;
case DEVICE_UPDATED:
break;
@@ -326,6 +330,24 @@
}
}
+ // Temporary mechanism to monitor pipeliner setup time-cost; there are
+ // intermittent time where this takes in excess of 2 seconds. Why?
+ private long totals = 0, count = 0;
+ private static final long LIMIT = 1;
+
+ private long startWatch() {
+ return System.currentTimeMillis();
+ }
+
+ private void stopWatch(long start) {
+ long duration = System.currentTimeMillis() - start;
+ totals += duration;
+ count += 1;
+ if (duration > LIMIT) {
+ log.info("Pipeline setup took {} ms; avg {} ms", duration, totals / count);
+ }
+ }
+
// Processing context for initializing pipeline driver behaviours.
private class InnerPipelineContext implements PipelinerContext {
@Override