Measuring topology performance. Fixing a defect that caused us to run w/o accumulator when config file was not present.

Change-Id: I5ad538b8a441cd6ff2aefea49a0def10b8e0f4d5
diff --git a/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java b/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
index 3f6e285..a5d2c5a 100644
--- a/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
+++ b/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
@@ -66,9 +66,9 @@
         implements TopologyProvider {
 
     private static final int MAX_THREADS = 8;
-    private static final int DEFAULT_MAX_EVENTS = 200;
-    private static final int DEFAULT_MAX_BATCH_MS = 60;
-    private static final int DEFAULT_MAX_IDLE_MS = 30;
+    private static final int DEFAULT_MAX_EVENTS = 1000;
+    private static final int DEFAULT_MAX_IDLE_MS = 10;
+    private static final int DEFAULT_MAX_BATCH_MS = 50;
 
     // FIXME: Replace with a system-wide timer instance;
     // TODO: Convert to use HashedWheelTimer or produce a variant of that; then decide which we want to adopt
@@ -116,15 +116,15 @@
     @Activate
     public synchronized void activate(ComponentContext context) {
         executor = newFixedThreadPool(MAX_THREADS, namedThreads("topo-build-%d"));
+        accumulator = new TopologyChangeAccumulator();
+        logConfig("Configured");
+
         modified(context);
 
         providerService = providerRegistry.register(this);
         deviceService.addListener(deviceListener);
         linkService.addListener(linkListener);
 
-        log.info("Configured with maxEvents = {}; maxBatchMs = {}; maxIdleMs = {}",
-                 maxEvents, maxBatchMs, maxIdleMs);
-
         isStarted = true;
         triggerRecompute();
         log.info("Started");
@@ -149,6 +149,7 @@
     public void modified(ComponentContext context) {
         if (context == null) {
             accumulator = new TopologyChangeAccumulator();
+            logConfig("Reconfigured");
             return;
         }
 
@@ -163,6 +164,7 @@
 
             s = (String) properties.get("maxIdleMs");
             newMaxIdleMs = isNullOrEmpty(s) ? maxIdleMs : Integer.parseInt(s);
+
         } catch (Exception e) {
             newMaxEvents = DEFAULT_MAX_EVENTS;
             newMaxBatchMs = DEFAULT_MAX_BATCH_MS;
@@ -174,11 +176,15 @@
             maxBatchMs = newMaxBatchMs;
             maxIdleMs = newMaxIdleMs;
             accumulator = maxEvents > 1 ? new TopologyChangeAccumulator() : null;
-            log.info("Reconfigured with maxEvents = {}; maxBatchMs = {}; maxIdleMs = {}",
-                     maxEvents, maxBatchMs, maxIdleMs);
+            logConfig("Reconfigured");
         }
     }
 
+    private void logConfig(String prefix) {
+        log.info("{} with maxEvents = {}; maxBatchMs = {}; maxIdleMs = {}; accumulator={}",
+                 prefix, maxEvents, maxBatchMs, maxIdleMs, accumulator != null);
+    }
+
 
     @Override
     public void triggerRecompute() {