From 457abaad0172763c148b38815d271d6089889214 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 13 Jul 2018 13:34:37 +0200 Subject: [PATCH] Remove ProcessWithContainerNameRenderer, it wasn't working (#3263) --- app/api_topologies.go | 2 +- render/benchmark_test.go | 4 ++-- render/process.go | 38 ++++---------------------------------- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/app/api_topologies.go b/app/api_topologies.go index dd3fb76a20..2c8cd1250b 100644 --- a/app/api_topologies.go +++ b/app/api_topologies.go @@ -197,7 +197,7 @@ func MakeRegistry() *Registry { registry.Add( APITopologyDesc{ id: processesID, - renderer: render.ProcessWithContainerNameRenderer, + renderer: render.ConnectedProcessRenderer, Name: "Processes", Rank: 1, Options: unconnectedFilter, diff --git a/render/benchmark_test.go b/render/benchmark_test.go index bdd98ceac4..1c6b5aeacc 100644 --- a/render/benchmark_test.go +++ b/render/benchmark_test.go @@ -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) } diff --git a/render/process.go b/render/process.go index d328e95c32..37e994133d 100644 --- a/render/process.go +++ b/render/process.go @@ -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" @@ -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.