Skip to content

Commit

Permalink
Backend for node shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Feb 5, 2016
1 parent fd7ced7 commit f03afc3
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 15 deletions.
44 changes: 44 additions & 0 deletions render/expected/expected.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import (

// Exported for testing.
var (
circle = "circle"
square = "square"
pentagon = "pentagon"
hexagon = "hexagon"
cloud = "cloud"

uncontainedServerID = render.MakePseudoNodeID(render.UncontainedID, fixture.ServerHostName)
unknownPseudoNode1ID = render.MakePseudoNodeID("10.10.10.10", fixture.ServerIP, "80")
unknownPseudoNode2ID = render.MakePseudoNodeID("10.10.10.11", fixture.ServerIP, "80")
Expand All @@ -18,6 +24,7 @@ var (
ID: unknownPseudoNode1ID,
LabelMajor: "10.10.10.10",
Pseudo: true,
Shape: circle,
Node: report.MakeNode().WithAdjacent(adjacent),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(70),
Expand All @@ -30,6 +37,7 @@ var (
ID: unknownPseudoNode2ID,
LabelMajor: "10.10.10.11",
Pseudo: true,
Shape: circle,
Node: report.MakeNode().WithAdjacent(adjacent),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(50),
Expand All @@ -42,6 +50,7 @@ var (
ID: render.TheInternetID,
LabelMajor: render.TheInternetMajor,
Pseudo: true,
Shape: cloud,
Node: report.MakeNode().WithAdjacent(adjacent),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(60),
Expand All @@ -61,6 +70,7 @@ var (
LabelMinor: fmt.Sprintf("%s (%s)", fixture.ClientHostID, fixture.Client1PID),
Rank: fixture.Client1Name,
Pseudo: false,
Shape: square,
Node: report.MakeNode().WithAdjacent(ServerProcessID),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(10),
Expand All @@ -73,6 +83,7 @@ var (
LabelMinor: fmt.Sprintf("%s (%s)", fixture.ClientHostID, fixture.Client2PID),
Rank: fixture.Client2Name,
Pseudo: false,
Shape: square,
Node: report.MakeNode().WithAdjacent(ServerProcessID),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(20),
Expand All @@ -85,6 +96,7 @@ var (
LabelMinor: fmt.Sprintf("%s (%s)", fixture.ServerHostID, fixture.ServerPID),
Rank: fixture.ServerName,
Pseudo: false,
Shape: square,
Node: report.MakeNode(),
EdgeMetadata: report.EdgeMetadata{
IngressPacketCount: newu64(210),
Expand All @@ -97,6 +109,7 @@ var (
LabelMinor: fmt.Sprintf("%s (%s)", fixture.ServerHostID, fixture.NonContainerPID),
Rank: fixture.NonContainerName,
Pseudo: false,
Shape: square,
Node: report.MakeNode().WithAdjacent(render.TheInternetID),
EdgeMetadata: report.EdgeMetadata{},
},
Expand All @@ -116,6 +129,8 @@ var (
LabelMinor: "2 processes",
Rank: fixture.Client1Name,
Pseudo: false,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
Expand All @@ -132,6 +147,8 @@ var (
LabelMinor: "1 process",
Rank: fixture.ServerName,
Pseudo: false,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
),
Expand All @@ -147,6 +164,8 @@ var (
LabelMinor: "1 process",
Rank: fixture.NonContainerName,
Pseudo: false,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
),
Expand All @@ -168,6 +187,7 @@ var (
LabelMinor: fixture.ClientHostName,
Rank: fixture.ClientContainerImageName,
Pseudo: false,
Shape: hexagon,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
Expand All @@ -185,6 +205,7 @@ var (
LabelMinor: fixture.ServerHostName,
Rank: fixture.ServerContainerImageName,
Pseudo: false,
Shape: hexagon,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
),
Expand All @@ -201,6 +222,8 @@ var (
LabelMinor: fixture.ServerHostName,
Rank: "",
Pseudo: true,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
),
Expand All @@ -220,6 +243,8 @@ var (
LabelMinor: "1 container",
Rank: fixture.ClientContainerImageName,
Pseudo: false,
Shape: hexagon,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
Expand All @@ -237,6 +262,8 @@ var (
LabelMinor: "1 container",
Rank: fixture.ServerContainerImageName,
Pseudo: false,
Shape: hexagon,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
Expand All @@ -253,6 +280,8 @@ var (
LabelMinor: fixture.ServerHostName,
Rank: "",
Pseudo: true,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
),
Expand All @@ -274,6 +303,7 @@ var (
LabelMinor: "hostname.com", // after first .
Rank: "hostname.com",
Pseudo: false,
Shape: circle,
Children: report.MakeNodeSet(
fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
fixture.Report.Container.Nodes[fixture.ServerProcessNodeID],
Expand All @@ -291,6 +321,7 @@ var (
LabelMinor: "hostname.com", // after first .
Rank: "hostname.com",
Pseudo: false,
Shape: circle,
Children: report.MakeNodeSet(
fixture.Report.Container.Nodes[fixture.ClientContainerNodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
Expand All @@ -307,6 +338,7 @@ var (
ID: pseudoHostID1,
LabelMajor: fixture.UnknownClient1IP,
Pseudo: true,
Shape: circle,
Node: report.MakeNode().WithAdjacent(ServerHostRenderedID),
EdgeMetadata: report.EdgeMetadata{},
Children: report.MakeNodeSet(
Expand All @@ -318,13 +350,15 @@ var (
ID: pseudoHostID2,
LabelMajor: fixture.UnknownClient3IP,
Pseudo: true,
Shape: circle,
Node: report.MakeNode().WithAdjacent(ServerHostRenderedID),
EdgeMetadata: report.EdgeMetadata{},
},
render.TheInternetID: {
ID: render.TheInternetID,
LabelMajor: render.TheInternetMajor,
Pseudo: true,
Shape: cloud,
Node: report.MakeNode().WithAdjacent(ServerHostRenderedID),
EdgeMetadata: report.EdgeMetadata{},
},
Expand All @@ -340,6 +374,7 @@ var (
LabelMinor: "1 container",
Rank: "ping/pong-a",
Pseudo: false,
Shape: pentagon,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
Expand All @@ -359,6 +394,7 @@ var (
LabelMinor: "1 container",
Rank: "ping/pong-b",
Pseudo: false,
Shape: pentagon,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
Expand All @@ -377,6 +413,8 @@ var (
LabelMinor: fixture.ServerHostName,
Rank: "",
Pseudo: true,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
),
Expand All @@ -387,6 +425,7 @@ var (
ID: render.TheInternetID,
LabelMajor: render.TheInternetMajor,
Pseudo: true,
Shape: cloud,
Node: report.MakeNode().WithAdjacent(ServerPodRenderedID),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(60),
Expand All @@ -404,6 +443,8 @@ var (
LabelMinor: "2 pods",
Rank: fixture.ServiceID,
Pseudo: false,
Shape: pentagon,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
Expand All @@ -429,6 +470,8 @@ var (
LabelMinor: fixture.ServerHostName,
Rank: "",
Pseudo: true,
Shape: square,
Stack: true,
Children: report.MakeNodeSet(
fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
),
Expand All @@ -439,6 +482,7 @@ var (
ID: render.TheInternetID,
LabelMajor: render.TheInternetMajor,
Pseudo: true,
Shape: cloud,
Node: report.MakeNode().WithAdjacent(ServiceRenderedID),
EdgeMetadata: report.EdgeMetadata{
EgressPacketCount: newu64(60),
Expand Down
Loading

0 comments on commit f03afc3

Please sign in to comment.