mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
tiny simplifying refactor
This commit is contained in:
@@ -56,13 +56,10 @@ func (e endpoints2Hosts) Render(rpt report.Report) Nodes {
|
||||
|
||||
for _, n := range endpoints.Nodes {
|
||||
// Nodes without a hostid are treated as pseudo nodes
|
||||
hostNodeID, timestamp, ok := n.Latest.LookupEntry(report.HostNodeID)
|
||||
if !ok {
|
||||
id, ok := pseudoNodeID(n, local)
|
||||
if !ok {
|
||||
continue
|
||||
if hostNodeID, timestamp, ok := n.Latest.LookupEntry(report.HostNodeID); !ok {
|
||||
if id, ok := pseudoNodeID(n, local); ok {
|
||||
ret.addChild(n, id, newPseudoNode)
|
||||
}
|
||||
ret.addChild(n, id, newPseudoNode)
|
||||
} else {
|
||||
id := report.MakeHostNodeID(report.ExtractHostID(n))
|
||||
ret.addChild(n, id, func(id string) report.Node {
|
||||
|
||||
@@ -155,14 +155,11 @@ func processes2Names(processes Nodes) Nodes {
|
||||
for _, n := range processes.Nodes {
|
||||
if n.Topology == Pseudo {
|
||||
ret.passThrough(n)
|
||||
} else {
|
||||
name, timestamp, ok := n.Latest.LookupEntry(process.Name)
|
||||
if ok {
|
||||
ret.addChildAndChildren(n, name, func(id string) report.Node {
|
||||
return report.MakeNode(id).WithTopology(MakeGroupNodeTopology(n.Topology, process.Name)).
|
||||
WithLatest(process.Name, timestamp, name)
|
||||
})
|
||||
}
|
||||
} else if name, timestamp, ok := n.Latest.LookupEntry(process.Name); ok {
|
||||
ret.addChildAndChildren(n, name, func(id string) report.Node {
|
||||
return report.MakeNode(id).WithTopology(MakeGroupNodeTopology(n.Topology, process.Name)).
|
||||
WithLatest(process.Name, timestamp, name)
|
||||
})
|
||||
}
|
||||
}
|
||||
ret.fixupAdjacencies(processes)
|
||||
|
||||
Reference in New Issue
Block a user