Move Counters into Latest

The only place Counters are used is in rendering, for the number of
nodes under a topology, so the overhead of holding a unique data
structure in every Node is unwarranted.
This commit is contained in:
Bryan Boreham
2019-10-20 10:16:36 +00:00
parent f73a220960
commit 4658568330
12 changed files with 68 additions and 345 deletions

View File

@@ -195,7 +195,7 @@ func (ret *joinResults) addUnmappedChild(m report.Node, id string, topology stri
}
result.Children.UnsafeAdd(m)
if m.Topology != report.Endpoint { // optimisation: we never look at endpoint counts
result.Counters = result.Counters.Add(m.Topology, 1)
result = result.WithCounter(m.Topology, 1)
}
ret.nodes[id] = result
}