mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-16 03:49:52 +00:00
refactor: inline connectionTracker.performFlowWalk
This commit is contained in:
@@ -91,24 +91,17 @@ func (t *connectionTracker) ReportConnections(rpt *report.Report) {
|
||||
t.useProcfs()
|
||||
}
|
||||
|
||||
// seenTuples contains information about connections seen by
|
||||
// conntrack
|
||||
seenTuples := t.performFlowWalk(rpt)
|
||||
|
||||
if t.conf.WalkProc && t.conf.Scanner != nil {
|
||||
t.performWalkProc(rpt, hostNodeID, seenTuples)
|
||||
}
|
||||
}
|
||||
|
||||
// performFlowWalk consults the flowWalker for short-lived connections
|
||||
func (t *connectionTracker) performFlowWalk(rpt *report.Report) map[string]fourTuple {
|
||||
// consult the flowWalker for short-lived (conntracked) connections
|
||||
seenTuples := map[string]fourTuple{}
|
||||
t.flowWalker.walkFlows(func(f flow, alive bool) {
|
||||
tuple := flowToTuple(f)
|
||||
seenTuples[tuple.key()] = tuple
|
||||
t.addConnection(rpt, false, tuple, "", nil, nil)
|
||||
})
|
||||
return seenTuples
|
||||
|
||||
if t.conf.WalkProc && t.conf.Scanner != nil {
|
||||
t.performWalkProc(rpt, hostNodeID, seenTuples)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *connectionTracker) existingFlows() map[string]fourTuple {
|
||||
|
||||
Reference in New Issue
Block a user