Skip to content

Commit

Permalink
Rename Internet to Inbound/Outbound Requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Nov 10, 2015
1 parent 17dec60 commit 2205144
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions render/expected/expected.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ var (
theIncomingInternetNode = func(adjacent string) render.RenderableNode {
return render.RenderableNode{
ID: render.IncomingInternetID,
LabelMajor: render.TheInternetMajor,
LabelMinor: render.Incoming,
LabelMajor: render.InboundMajor,
LabelMinor: render.RequestsMinor,
Pseudo: true,
Node: report.MakeNode().WithAdjacent(adjacent),
EdgeMetadata: report.EdgeMetadata{
Expand All @@ -62,8 +62,8 @@ var (
}
theOutgoingInternetNode = render.RenderableNode{
ID: render.OutgoingInternetID,
LabelMajor: render.TheInternetMajor,
LabelMinor: render.Outgoing,
LabelMajor: render.OutboundMajor,
LabelMinor: render.RequestsMinor,
Pseudo: true,
Node: report.MakeNode(),
EdgeMetadata: report.EdgeMetadata{},
Expand Down Expand Up @@ -378,8 +378,8 @@ var (
},
render.IncomingInternetID: {
ID: render.IncomingInternetID,
LabelMajor: render.TheInternetMajor,
LabelMinor: render.Incoming,
LabelMajor: render.InboundMajor,
LabelMinor: render.RequestsMinor,
Pseudo: true,
Node: report.MakeNode().WithAdjacent(ServerHostRenderedID),
EdgeMetadata: report.EdgeMetadata{},
Expand Down
14 changes: 8 additions & 6 deletions render/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const (
TheInternetID = "theinternet"
IncomingInternetID = "in-" + TheInternetID
OutgoingInternetID = "out-" + TheInternetID
TheInternetMajor = "The Internet"
Incoming = "Incoming"
Outgoing = "Outgoing"
InboundMajor = "Inbound"
OutboundMajor = "Outbound"
RequestsMinor = "Requests"

containersKey = "containers"
podsKey = "pods"
Expand All @@ -42,14 +42,16 @@ const (
type MapFunc func(RenderableNode, report.Networks) RenderableNodes

func generateInternetNodeFor(m RenderableNode) RenderableNodes {
node := newDerivedPseudoNode("", TheInternetMajor, m)
node := newDerivedPseudoNode("", "", m)
// emit one internet node for incoming, one for outgoing
if len(m.Adjacency) > 0 {
node.ID = IncomingInternetID
node.LabelMinor = Incoming
node.LabelMajor = InboundMajor
node.LabelMinor = RequestsMinor
} else {
node.ID = OutgoingInternetID
node.LabelMinor = Outgoing
node.LabelMajor = OutboundMajor
node.LabelMinor = RequestsMinor
}
return RenderableNodes{node.ID: node}
}
Expand Down
4 changes: 2 additions & 2 deletions render/short_lived_connections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ var (
want = (render.RenderableNodes{
render.IncomingInternetID: {
ID: render.IncomingInternetID,
LabelMajor: render.TheInternetMajor,
LabelMinor: render.Incoming,
LabelMajor: render.InboundMajor,
LabelMinor: render.RequestsMinor,
Pseudo: true,
Node: report.MakeNode().WithAdjacent(containerID),
Origins: report.MakeIDList(randomEndpointNodeID),
Expand Down

0 comments on commit 2205144

Please sign in to comment.