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/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java b/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
index 4aafa35..939e558 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
@@ -65,6 +65,7 @@
new TarjanGraphSearch<>();
private final long time;
+ private final long computeCost;
private final TopologyGraph graph;
private final SCCResult<TopologyVertex, TopologyEdge> clusterResults;
@@ -104,6 +105,7 @@
this.broadcastSets = buildBroadcastSets();
this.infrastructurePoints = findInfrastructurePoints();
+ this.computeCost = Math.max(0, System.nanoTime() - time);
}
@Override
@@ -112,6 +114,11 @@
}
@Override
+ public long computeCost() {
+ return computeCost;
+ }
+
+ @Override
public int clusterCount() {
return clusters.size();
}
@@ -453,6 +460,7 @@
public String toString() {
return toStringHelper(this)
.add("time", time)
+ .add("computeCost", computeCost)
.add("clusters", clusterCount())
.add("devices", deviceCount())
.add("links", linkCount())