mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-06 09:18:27 +00:00
performance: Send active controls as a single string per node
Instead of a whole extra data structure which is quite expensive to marshal and unmarshal, just send the information in a string. No clever merging strategy is required - the states are all set in one place per node type.
This commit is contained in:
@@ -2,7 +2,6 @@ package detailed
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/ugorji/go/codec"
|
||||
|
||||
@@ -112,10 +111,7 @@ func controlsFor(topology report.Topology, nodeID string) []ControlInstance {
|
||||
if !ok {
|
||||
return result
|
||||
}
|
||||
node.LatestControls.ForEach(func(controlID string, _ time.Time, data report.NodeControlData) {
|
||||
if data.Dead {
|
||||
return
|
||||
}
|
||||
for _, controlID := range node.ActiveControls() {
|
||||
if control, ok := topology.Controls[controlID]; ok {
|
||||
result = append(result, ControlInstance{
|
||||
ProbeID: probeID,
|
||||
@@ -123,7 +119,7 @@ func controlsFor(topology report.Topology, nodeID string) []ControlInstance {
|
||||
Control: control,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user