Skip to content

Commit

Permalink
Remove ProcessWithContainerNameRenderer, it wasn't working (weavework…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta authored and satyamz committed Jul 26, 2018
1 parent 104730d commit 457abaa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app/api_topologies.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func MakeRegistry() *Registry {
registry.Add(
APITopologyDesc{
id: processesID,
renderer: render.ProcessWithContainerNameRenderer,
renderer: render.ConnectedProcessRenderer,
Name: "Processes",
Rank: 1,
Options: unconnectedFilter,
Expand Down
4 changes: 2 additions & 2 deletions render/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ var (

func BenchmarkEndpointRender(b *testing.B) { benchmarkRender(b, render.EndpointRenderer) }
func BenchmarkProcessRender(b *testing.B) { benchmarkRender(b, render.ProcessRenderer) }
func BenchmarkProcessWithContainerNameRender(b *testing.B) {
benchmarkRender(b, render.ProcessWithContainerNameRenderer)
func BenchmarkConnectedProcessRender(b *testing.B) {
benchmarkRender(b, render.ConnectedProcessRenderer)
}
func BenchmarkProcessNameRender(b *testing.B) { benchmarkRender(b, render.ProcessNameRenderer) }
func BenchmarkContainerRender(b *testing.B) { benchmarkRender(b, render.ContainerRenderer) }
Expand Down
38 changes: 4 additions & 34 deletions render/process.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package render

import (
"github.com/weaveworks/scope/probe/docker"
"github.com/weaveworks/scope/probe/endpoint"
"github.com/weaveworks/scope/probe/process"
"github.com/weaveworks/scope/report"
Expand All @@ -23,41 +22,12 @@ func renderProcesses(rpt report.Report) bool {
// graph by merging the endpoint graph and the process topology.
var ProcessRenderer = Memoise(endpoints2Processes{})

// processWithContainerNameRenderer is a Renderer which produces a process
// graph enriched with container names where appropriate
type processWithContainerNameRenderer struct {
Renderer
}

func (r processWithContainerNameRenderer) Render(rpt report.Report) Nodes {
processes := r.Renderer.Render(rpt)
containers := SelectContainer.Render(rpt)

outputs := make(report.Nodes, len(processes.Nodes))
for id, p := range processes.Nodes {
outputs[id] = p
containerID, ok := p.Latest.Lookup(docker.ContainerID)
if !ok {
continue
}
container, ok := containers.Nodes[report.MakeContainerNodeID(containerID)]
if !ok {
continue
}
propagateLatest(docker.ContainerName, container, p)
outputs[id] = p
}
return Nodes{Nodes: outputs, Filtered: processes.Filtered}
}

// ProcessWithContainerNameRenderer is a Renderer which produces a
// process graph enriched with container names where appropriate.
//
// It also colors connected nodes, so we can apply a filter to
// show/hide unconnected nodes depending on user choice.
// ConnectedProcessRenderer is a Renderer which colors
// connected nodes, so we can apply a filter to show/hide unconnected
// nodes depending on user choice.
//
// not memoised
var ProcessWithContainerNameRenderer = ColorConnected(processWithContainerNameRenderer{ProcessRenderer})
var ConnectedProcessRenderer = ColorConnected(ProcessRenderer)

// ProcessNameRenderer is a Renderer which produces a renderable
// process name graph by munging the progess graph.
Expand Down

0 comments on commit 457abaa

Please sign in to comment.