Skip to content

Commit

Permalink
always apply ColorConnected in process renderers
Browse files Browse the repository at this point in the history
This eliminates the awkward distinction between ProcessRenderer and
ColorConnectedProcessRenderer.

It also ensures that processes resulting from direct rendering of the
process topology (/api/topology/processes is invoking
ProcessWithContainerNameRenderer and /api/topology/processes-by-name
is invoking ProcessNameRenderer) are colored and hence summarising
them correctly sets the 'linkable' property. This was the behaviour
prior to the revamping of the rendering pipeline. However, it doesn't
actually make a practical difference since process detail panels only
show other processes as connection endpoints, and these are always
marked linkable anyway.
  • Loading branch information
rade committed Nov 27, 2017
1 parent df90016 commit 2b5bc80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion render/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var ContainerRenderer = Memoise(MakeFilter(
MakeReduce(
MakeMap(
MapProcess2Container,
ColorConnectedProcessRenderer,
ProcessRenderer,
),
ConnectionJoin(MapContainer2IP, SelectContainer),
),
Expand Down
2 changes: 1 addition & 1 deletion render/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// not memoised
var HostRenderer = MakeReduce(
endpoints2Hosts{},
CustomRenderer{RenderFunc: nodes2Hosts, Renderer: ColorConnectedProcessRenderer},
CustomRenderer{RenderFunc: nodes2Hosts, Renderer: ProcessRenderer},
CustomRenderer{RenderFunc: nodes2Hosts, Renderer: ContainerRenderer},
CustomRenderer{RenderFunc: nodes2Hosts, Renderer: ContainerImageRenderer},
CustomRenderer{RenderFunc: nodes2Hosts, Renderer: PodRenderer},
Expand Down
11 changes: 4 additions & 7 deletions render/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ func renderProcesses(rpt report.Report) bool {
var EndpointRenderer = SelectEndpoint

// ProcessRenderer is a Renderer which produces a renderable process
// graph by merging the endpoint graph and the process topology.
var ProcessRenderer = Memoise(endpoints2Processes{})

// ColorConnectedProcessRenderer colors connected nodes from
// ProcessRenderer. Since the process topology views only show
// connected processes, we need this info to determine whether
// graph by merging the endpoint graph and the process topology. It
// also colors connected nodes. Since the process topology views only
// show connected processes, we need this info to determine whether
// processes appearing in a details panel are linkable.
var ColorConnectedProcessRenderer = Memoise(ColorConnected(ProcessRenderer))
var ProcessRenderer = Memoise(ColorConnected(endpoints2Processes{}))

// processWithContainerNameRenderer is a Renderer which produces a process
// graph enriched with container names where appropriate
Expand Down

0 comments on commit 2b5bc80

Please sign in to comment.