Skip to content

Commit

Permalink
don't propagate HostNodeID in endpoints2Hosts
Browse files Browse the repository at this point in the history
The HostNodeID is already the id of host nodes (as the name suggests),
and that's what summarisation renders. Nothing looks at the HostNodeID
metadata of host nodes.
  • Loading branch information
rade committed Dec 28, 2017
1 parent a3ba3a5 commit bbd6c5f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions render/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,12 @@ func (e endpoints2Hosts) Render(rpt report.Report) Nodes {

for _, n := range endpoints.Nodes {
// Nodes without a hostid are treated as pseudo nodes
if hostNodeID, timestamp, ok := n.Latest.LookupEntry(report.HostNodeID); !ok {
if hostNodeID, ok := n.Latest.Lookup(report.HostNodeID); !ok {
if id, ok := pseudoNodeID(n, local); ok {
ret.addChild(n, id, newPseudoNode)
}
} else {
id := report.MakeHostNodeID(report.ExtractHostID(n))
ret.addChild(n, id, func(id string) report.Node {
// we have a hostNodeID, but no matching host node;
// create a new one rather than dropping the data
return newHostNode(id).
WithLatest(report.HostNodeID, timestamp, hostNodeID)
})
ret.addChild(n, hostNodeID, newHostNode)

This comment has been minimized.

Copy link
@bboreham

bboreham Dec 29, 2017

Collaborator

What changes now we don't do MakeHostNodeID(ExtractHostID()) ?

This comment has been minimized.

Copy link
@rade

rade Dec 29, 2017

Author Member

Nothing. The line I removed was superfluous; we already have the hostNodeID.

}
}
return ret.result(endpoints)
Expand Down

0 comments on commit bbd6c5f

Please sign in to comment.