diff --git a/app/api_topologies.go b/app/api_topologies.go index ce598defbc..37f4f20eb7 100644 --- a/app/api_topologies.go +++ b/app/api_topologies.go @@ -22,6 +22,7 @@ var ( id: "pods", renderer: render.PodRenderer, Name: "Pods", + Rank: 3, Options: map[string][]APITopologyOption{"system": { {"show", "System pods shown", false, render.FilterNoop}, {"hide", "System pods hidden", true, render.FilterSystem}, @@ -56,9 +57,10 @@ func init() { // be the verb to get to that state topologyRegistry.add( APITopologyDesc{ - id: "applications", + id: "processes", renderer: render.FilterUnconnected(render.ProcessWithContainerNameRenderer), - Name: "Applications", + Name: "Processes", + Rank: 1, Options: map[string][]APITopologyOption{"unconnected": { // Show the user why there are filtered nodes in this view. // Don't give them the option to show those nodes. @@ -66,8 +68,8 @@ func init() { }}, }, APITopologyDesc{ - id: "applications-by-name", - parent: "applications", + id: "processes-by-name", + parent: "processes", renderer: render.FilterUnconnected(render.ProcessNameRenderer), Name: "by name", Options: map[string][]APITopologyOption{"unconnected": { @@ -79,6 +81,7 @@ func init() { id: "containers", renderer: render.ContainerWithImageNameRenderer, Name: "Containers", + Rank: 2, Options: containerFilters, }, APITopologyDesc{ @@ -99,6 +102,7 @@ func init() { id: "hosts", renderer: render.HostRenderer, Name: "Hosts", + Rank: 4, Options: map[string][]APITopologyOption{}, }, ) @@ -117,6 +121,7 @@ type APITopologyDesc struct { renderer render.Renderer Name string `json:"name"` + Rank int `json:"rank"` Options map[string][]APITopologyOption `json:"options"` URL string `json:"url"` diff --git a/app/api_topology_test.go b/app/api_topology_test.go index 0282710fa3..1f36171db1 100644 --- a/app/api_topology_test.go +++ b/app/api_topology_test.go @@ -71,12 +71,12 @@ func TestAPITopologyContainers(t *testing.T) { } } -func TestAPITopologyApplications(t *testing.T) { +func TestAPITopologyProcesses(t *testing.T) { ts := topologyServer() defer ts.Close() - is404(t, ts, "/api/topology/applications/foobar") + is404(t, ts, "/api/topology/processes/foobar") { - body := getRawJSON(t, ts, "/api/topology/applications/"+expected.ServerProcessID) + body := getRawJSON(t, ts, "/api/topology/processes/"+expected.ServerProcessID) var node app.APINode if err := json.Unmarshal(body, &node); err != nil { t.Fatal(err) @@ -88,7 +88,7 @@ func TestAPITopologyApplications(t *testing.T) { } { - body := getRawJSON(t, ts, "/api/topology/applications-by-name/"+ + body := getRawJSON(t, ts, "/api/topology/processes-by-name/"+ url.QueryEscape(fixture.Client1Name)) var node app.APINode if err := json.Unmarshal(body, &node); err != nil { @@ -133,7 +133,7 @@ func TestAPITopologyHosts(t *testing.T) { func TestAPITopologyWebsocket(t *testing.T) { ts := topologyServer() defer ts.Close() - url := "/api/topology/applications/ws" + url := "/api/topology/processes/ws" // Not a websocket request res, _ := checkGet(t, ts, url) diff --git a/client/app/scripts/components/topologies.js b/client/app/scripts/components/topologies.js index 3566d2b34c..cc99cc1982 100644 --- a/client/app/scripts/components/topologies.js +++ b/client/app/scripts/components/topologies.js @@ -58,7 +58,7 @@ export default class Topologies extends React.Component { render() { const topologies = _.sortBy(this.props.topologies, function(topology) { - return topology.name; + return topology.rank; }); return ( diff --git a/experimental/_integration/easy_test.go b/experimental/_integration/easy_test.go index 167fc2beee..08e2260e06 100644 --- a/experimental/_integration/easy_test.go +++ b/experimental/_integration/easy_test.go @@ -26,12 +26,12 @@ func TestComponentsAreAvailable(t *testing.T) { } } -func TestApplications(t *testing.T) { +func TestProcesses(t *testing.T) { withContext(t, oneProbe, func() { - topo := parseTopology(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/applications", appPort))) + topo := parseTopology(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/processes", appPort))) assertAdjacent(t, topo["proc:node-1.2.3.4:apache"], "theinternet", "proc:node-192.168.1.1:wget") want := map[string]interface{}{"max_conn_count_tcp": float64(19)} - have := parseEdge(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/applications/%s/%s", appPort, "proc:node-192.168.1.1:wget", "theinternet"))) + have := parseEdge(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/processes/%s/%s", appPort, "proc:node-192.168.1.1:wget", "theinternet"))) if !reflect.DeepEqual(have, want) { t.Errorf("have: %#v, want %#v", have, want) } @@ -56,7 +56,7 @@ func TestHosts(t *testing.T) { func TestMultipleProbes(t *testing.T) { withContext(t, twoProbes, func() { - topo := parseTopology(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/applications", appPort))) + topo := parseTopology(t, httpGet(t, fmt.Sprintf("http://localhost:%d/api/topology/processes", appPort))) assertAdjacent(t, topo["proc:node-1.2.3.4:apache"], "theinternet", "proc:node-192.168.1.1:wget", "proc:node-192.168.1.1:curl") }) } diff --git a/experimental/graphviz/render.go b/experimental/graphviz/render.go index 6f9fd6b0a1..ad36b3c723 100644 --- a/experimental/graphviz/render.go +++ b/experimental/graphviz/render.go @@ -9,11 +9,11 @@ import ( func renderTo(rpt report.Report, topology string) (render.RenderableNodes, error) { renderer, ok := map[string]render.Renderer{ - "applications": render.FilterUnconnected(render.ProcessWithContainerNameRenderer), - "applications-by-name": render.FilterUnconnected(render.ProcessNameRenderer), - "containers": render.ContainerWithImageNameRenderer, - "containers-by-image": render.ContainerImageRenderer, - "hosts": render.HostRenderer, + "processes": render.FilterUnconnected(render.ProcessWithContainerNameRenderer), + "processes-by-name": render.FilterUnconnected(render.ProcessNameRenderer), + "containers": render.ContainerWithImageNameRenderer, + "containers-by-image": render.ContainerImageRenderer, + "hosts": render.HostRenderer, }[topology] if !ok { return render.RenderableNodes{}, fmt.Errorf("unknown topology %v", topology) diff --git a/integration/330_application_edge_test.sh b/integration/330_process_edge_test.sh similarity index 64% rename from integration/330_application_edge_test.sh rename to integration/330_process_edge_test.sh index 712813f293..6927a19644 100755 --- a/integration/330_application_edge_test.sh +++ b/integration/330_process_edge_test.sh @@ -12,10 +12,10 @@ weave_on $HOST1 run -dti --name client alpine /bin/sh -c "while true; do \ sleep 1; \ done" -wait_for applications $HOST1 60 "nginx: worker process" nc +wait_for processes $HOST1 60 "nginx: worker process" nc -has applications $HOST1 "nginx: worker process" -has applications $HOST1 nc -has_connection applications $HOST1 nc "nginx: worker process" +has processes $HOST1 "nginx: worker process" +has processes $HOST1 nc +has_connection processes $HOST1 nc "nginx: worker process" scope_end_suite diff --git a/integration/340_application_edge_across_host_2_test.sh b/integration/340_process_edge_across_host_2_test.sh similarity index 81% rename from integration/340_application_edge_across_host_2_test.sh rename to integration/340_process_edge_across_host_2_test.sh index 35748b0b9a..60d3622362 100755 --- a/integration/340_application_edge_across_host_2_test.sh +++ b/integration/340_process_edge_across_host_2_test.sh @@ -19,9 +19,9 @@ done" sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports check() { - has applications $1 "nginx: worker process" - has applications $1 nc - has_connection applications $1 nc "nginx: worker process" + has processes $1 "nginx: worker process" + has processes $1 nc + has_connection processes $1 nc "nginx: worker process" } check $HOST1 diff --git a/render/detailed/node.go b/render/detailed/node.go index 80dce216fd..0289e3e916 100644 --- a/render/detailed/node.go +++ b/render/detailed/node.go @@ -95,7 +95,7 @@ var ( {report.Pod, NodeSummaryGroup{TopologyID: "pods", Label: "Pods", Columns: []string{}}}, {report.ContainerImage, NodeSummaryGroup{TopologyID: "containers-by-image", Label: "Container Images", Columns: []string{}}}, {report.Container, NodeSummaryGroup{TopologyID: "containers", Label: "Containers", Columns: []string{docker.CPUTotalUsage, docker.MemoryUsage}}}, - {report.Process, NodeSummaryGroup{TopologyID: "applications", Label: "Applications", Columns: []string{process.PID, process.CPUUsage, process.MemoryUsage}}}, + {report.Process, NodeSummaryGroup{TopologyID: "processes", Label: "Processes", Columns: []string{process.PID, process.CPUUsage, process.MemoryUsage}}}, } ) diff --git a/render/detailed/node_test.go b/render/detailed/node_test.go index feded6e6f8..762ea0209b 100644 --- a/render/detailed/node_test.go +++ b/render/detailed/node_test.go @@ -101,8 +101,8 @@ func TestMakeDetailedHostNode(t *testing.T) { Nodes: []detailed.NodeSummary{containerNodeSummary}, }, { - Label: "Applications", - TopologyID: "applications", + Label: "Processes", + TopologyID: "processes", Columns: []string{process.PID, process.CPUUsage, process.MemoryUsage}, Nodes: []detailed.NodeSummary{process1NodeSummary, process2NodeSummary}, }, @@ -156,8 +156,8 @@ func TestMakeDetailedContainerNode(t *testing.T) { Controls: []detailed.ControlInstance{}, Children: []detailed.NodeSummaryGroup{ { - Label: "Applications", - TopologyID: "applications", + Label: "Processes", + TopologyID: "processes", Columns: []string{process.PID, process.CPUUsage, process.MemoryUsage}, Nodes: []detailed.NodeSummary{ {