mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Make merging of node children conditional in addToResults
Some operations won't want this.
This commit is contained in:
committed by
Matthias Radestock
parent
e475c2af1d
commit
db41cab0af
@@ -160,13 +160,15 @@ func newJoinResults() joinResults {
|
||||
|
||||
// Add Node M under id, creating a new result node if not already there
|
||||
// incrementing a counter if nonblank, and updating the mapping from old ID to new ID
|
||||
func (ret *joinResults) addToResults(m report.Node, id string, create func(string) report.Node, counters ...string) {
|
||||
func (ret *joinResults) addToResults(m report.Node, id string, addChildren bool, create func(string) report.Node, counters ...string) {
|
||||
result, exists := ret.nodes[id]
|
||||
if !exists {
|
||||
result = create(id)
|
||||
}
|
||||
result.Children = result.Children.Add(m)
|
||||
result.Children = result.Children.Merge(m.Children)
|
||||
if addChildren {
|
||||
result.Children = result.Children.Merge(m.Children)
|
||||
}
|
||||
for _, c := range counters {
|
||||
result.Counters = result.Counters.Add(c, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user