expected

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClientProcess1ID = render.MakeProcessID(fixture.ClientHostID, fixture.Client1PID)
	ClientProcess2ID = render.MakeProcessID(fixture.ClientHostID, fixture.Client2PID)
	ServerProcessID  = render.MakeProcessID(fixture.ServerHostID, fixture.ServerPID)

	RenderedProcesses = (render.RenderableNodes{
		ClientProcess1ID: {
			ID:         ClientProcess1ID,
			LabelMajor: fixture.Client1Name,
			LabelMinor: fmt.Sprintf("%s (%s)", fixture.ClientHostID, fixture.Client1PID),
			Rank:       fixture.Client1Name,
			Pseudo:     false,
			Node:       report.MakeNode().WithAdjacent(ServerProcessID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(10),
				EgressByteCount:   newu64(100),
			},
		},
		ClientProcess2ID: {
			ID:         ClientProcess2ID,
			LabelMajor: fixture.Client2Name,
			LabelMinor: fmt.Sprintf("%s (%s)", fixture.ClientHostID, fixture.Client2PID),
			Rank:       fixture.Client2Name,
			Pseudo:     false,
			Node:       report.MakeNode().WithAdjacent(ServerProcessID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(20),
				EgressByteCount:   newu64(200),
			},
		},
		ServerProcessID: {
			ID:         ServerProcessID,
			LabelMajor: fixture.ServerName,
			LabelMinor: fmt.Sprintf("%s (%s)", fixture.ServerHostID, fixture.ServerPID),
			Rank:       fixture.ServerName,
			Pseudo:     false,
			Node:       report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
		},
		nonContainerProcessID: {
			ID:           nonContainerProcessID,
			LabelMajor:   fixture.NonContainerName,
			LabelMinor:   fmt.Sprintf("%s (%s)", fixture.ServerHostID, fixture.NonContainerPID),
			Rank:         fixture.NonContainerName,
			Pseudo:       false,
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		unknownPseudoNode1ID: unknownPseudoNode1(ServerProcessID),
		unknownPseudoNode2ID: unknownPseudoNode2(ServerProcessID),
		render.TheInternetID: theInternetNode(ServerProcessID),
	}).Prune()

	ServerProcessRenderedID  = render.MakeProcessID(fixture.ServerHostID, fixture.ServerPID)
	ClientProcess1RenderedID = render.MakeProcessID(fixture.ClientHostID, fixture.Client1PID)
	ClientProcess2RenderedID = render.MakeProcessID(fixture.ClientHostID, fixture.Client2PID)

	RenderedProcessNames = (render.RenderableNodes{
		fixture.Client1Name: {
			ID:         fixture.Client1Name,
			LabelMajor: fixture.Client1Name,
			LabelMinor: "2 processes",
			Rank:       fixture.Client1Name,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
			),
			Node: report.MakeNode().WithAdjacent(fixture.ServerName),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(30),
				EgressByteCount:   newu64(300),
			},
		},
		fixture.ServerName: {
			ID:         fixture.ServerName,
			LabelMajor: fixture.ServerName,
			LabelMinor: "1 process",
			Rank:       fixture.ServerName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
			),
			Node: report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
		},
		fixture.NonContainerName: {
			ID:         fixture.NonContainerName,
			LabelMajor: fixture.NonContainerName,
			LabelMinor: "1 process",
			Rank:       fixture.NonContainerName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
			),
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		unknownPseudoNode1ID: unknownPseudoNode1(fixture.ServerName),
		unknownPseudoNode2ID: unknownPseudoNode2(fixture.ServerName),
		render.TheInternetID: theInternetNode(fixture.ServerName),
	}).Prune()

	ServerContainerRenderedID = render.MakeContainerID(fixture.ServerContainerID)
	ClientContainerRenderedID = render.MakeContainerID(fixture.ClientContainerID)

	RenderedContainers = (render.RenderableNodes{
		ClientContainerRenderedID: {
			ID:         ClientContainerRenderedID,
			LabelMajor: "client",
			LabelMinor: fixture.ClientHostName,
			Rank:       fixture.ClientContainerImageName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
			),
			Node: report.MakeNode().WithAdjacent(ServerContainerRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(30),
				EgressByteCount:   newu64(300),
			},
			ControlNode: fixture.ClientContainerNodeID,
		},
		ServerContainerRenderedID: {
			ID:         ServerContainerRenderedID,
			LabelMajor: "server",
			LabelMinor: fixture.ServerHostName,
			Rank:       fixture.ServerContainerImageName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
			),
			Node: report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
			ControlNode: fixture.ServerContainerNodeID,
		},
		uncontainedServerID: {
			ID:         uncontainedServerID,
			LabelMajor: render.UncontainedMajor,
			LabelMinor: fixture.ServerHostName,
			Rank:       "",
			Pseudo:     true,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
			),
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		render.TheInternetID: theInternetNode(ServerContainerRenderedID),
	}).Prune()

	ClientContainerImageRenderedName = render.MakeContainerImageID(fixture.ClientContainerImageName)
	ServerContainerImageRenderedName = render.MakeContainerImageID(fixture.ServerContainerImageName)

	RenderedContainerImages = (render.RenderableNodes{
		ClientContainerImageRenderedName: {
			ID:         ClientContainerImageRenderedName,
			LabelMajor: fixture.ClientContainerImageName,
			LabelMinor: "1 container",
			Rank:       fixture.ClientContainerImageName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
				fixture.Report.Container.Nodes[fixture.ClientContainerNodeID],
			),
			Node: report.MakeNode().WithAdjacent(ServerContainerImageRenderedName),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(30),
				EgressByteCount:   newu64(300),
			},
		},
		ServerContainerImageRenderedName: {
			ID:         ServerContainerImageRenderedName,
			LabelMajor: fixture.ServerContainerImageName,
			LabelMinor: "1 container",
			Rank:       fixture.ServerContainerImageName,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
				fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
			),
			Node: report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
		},
		uncontainedServerID: {
			ID:         uncontainedServerID,
			LabelMajor: render.UncontainedMajor,
			LabelMinor: fixture.ServerHostName,
			Rank:       "",
			Pseudo:     true,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
			),
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		render.TheInternetID: theInternetNode(ServerContainerImageRenderedName),
	}).Prune()

	ServerHostRenderedID = render.MakeHostID(fixture.ServerHostID)
	ClientHostRenderedID = render.MakeHostID(fixture.ClientHostID)

	RenderedHosts = (render.RenderableNodes{
		ServerHostRenderedID: {
			ID:         ServerHostRenderedID,
			LabelMajor: "server",
			LabelMinor: "hostname.com",
			Rank:       "hostname.com",
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
				fixture.Report.Container.Nodes[fixture.ServerProcessNodeID],
			),
			Node: report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
				MaxConnCountTCP:    newu64(3),
			},
		},
		ClientHostRenderedID: {
			ID:         ClientHostRenderedID,
			LabelMajor: "client",
			LabelMinor: "hostname.com",
			Rank:       "hostname.com",
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Container.Nodes[fixture.ClientContainerNodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
			),
			Node: report.MakeNode().WithAdjacent(ServerHostRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(30),
				EgressByteCount:   newu64(300),
				MaxConnCountTCP:   newu64(3),
			},
		},
		pseudoHostID1: {
			ID:           pseudoHostID1,
			LabelMajor:   fixture.UnknownClient1IP,
			Pseudo:       true,
			Node:         report.MakeNode().WithAdjacent(ServerHostRenderedID),
			EdgeMetadata: report.EdgeMetadata{},
			Children: report.MakeNodeSet(
				fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
			),
		},
		pseudoHostID2: {
			ID:           pseudoHostID2,
			LabelMajor:   fixture.UnknownClient3IP,
			Pseudo:       true,
			Node:         report.MakeNode().WithAdjacent(ServerHostRenderedID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		render.TheInternetID: {
			ID:           render.TheInternetID,
			LabelMajor:   render.TheInternetMajor,
			Pseudo:       true,
			Node:         report.MakeNode().WithAdjacent(ServerHostRenderedID),
			EdgeMetadata: report.EdgeMetadata{},
		},
	}).Prune()

	ClientPodRenderedID = render.MakePodID("ping/pong-a")
	ServerPodRenderedID = render.MakePodID("ping/pong-b")

	RenderedPods = (render.RenderableNodes{
		ClientPodRenderedID: {
			ID:         ClientPodRenderedID,
			LabelMajor: "pong-a",
			LabelMinor: "1 container",
			Rank:       "ping/pong-a",
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
				fixture.Report.Container.Nodes[fixture.ClientContainerNodeID],
				fixture.Report.ContainerImage.Nodes[fixture.ClientContainerImageNodeID],
				fixture.Report.Pod.Nodes[fixture.ClientPodNodeID],
			),
			Node: report.MakeNode().WithAdjacent(ServerPodRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(30),
				EgressByteCount:   newu64(300),
			},
		},
		ServerPodRenderedID: {
			ID:         ServerPodRenderedID,
			LabelMajor: "pong-b",
			LabelMinor: "1 container",
			Rank:       "ping/pong-b",
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
				fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
				fixture.Report.ContainerImage.Nodes[fixture.ServerContainerImageNodeID],
				fixture.Report.Pod.Nodes[fixture.ServerPodNodeID],
			),
			Node: report.MakeNode(),
			EdgeMetadata: report.EdgeMetadata{
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
		},
		uncontainedServerID: {
			ID:         uncontainedServerID,
			LabelMajor: render.UncontainedMajor,
			LabelMinor: fixture.ServerHostName,
			Rank:       "",
			Pseudo:     true,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
			),
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		render.TheInternetID: {
			ID:         render.TheInternetID,
			LabelMajor: render.TheInternetMajor,
			Pseudo:     true,
			Node:       report.MakeNode().WithAdjacent(ServerPodRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(60),
				EgressByteCount:   newu64(600),
			},
		},
	}).Prune()

	ServiceRenderedID = render.MakeServiceID("ping/pongservice")

	RenderedPodServices = (render.RenderableNodes{
		ServiceRenderedID: {
			ID:         ServiceRenderedID,
			LabelMajor: "pongservice",
			LabelMinor: "2 pods",
			Rank:       fixture.ServiceID,
			Pseudo:     false,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.ClientProcess1NodeID],
				fixture.Report.Process.Nodes[fixture.ClientProcess2NodeID],
				fixture.Report.Container.Nodes[fixture.ClientContainerNodeID],
				fixture.Report.ContainerImage.Nodes[fixture.ClientContainerImageNodeID],
				fixture.Report.Pod.Nodes[fixture.ClientPodNodeID],
				fixture.Report.Process.Nodes[fixture.ServerProcessNodeID],
				fixture.Report.Container.Nodes[fixture.ServerContainerNodeID],
				fixture.Report.ContainerImage.Nodes[fixture.ServerContainerImageNodeID],
				fixture.Report.Pod.Nodes[fixture.ServerPodNodeID],
			),
			Node: report.MakeNode().WithAdjacent(ServiceRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount:  newu64(30),
				EgressByteCount:    newu64(300),
				IngressPacketCount: newu64(210),
				IngressByteCount:   newu64(2100),
			},
		},
		uncontainedServerID: {
			ID:         uncontainedServerID,
			LabelMajor: render.UncontainedMajor,
			LabelMinor: fixture.ServerHostName,
			Rank:       "",
			Pseudo:     true,
			Children: report.MakeNodeSet(
				fixture.Report.Process.Nodes[fixture.NonContainerProcessNodeID],
			),
			Node:         report.MakeNode().WithAdjacent(render.TheInternetID),
			EdgeMetadata: report.EdgeMetadata{},
		},
		render.TheInternetID: {
			ID:         render.TheInternetID,
			LabelMajor: render.TheInternetMajor,
			Pseudo:     true,
			Node:       report.MakeNode().WithAdjacent(ServiceRenderedID),
			EdgeMetadata: report.EdgeMetadata{
				EgressPacketCount: newu64(60),
				EgressByteCount:   newu64(600),
			},
		},
	}).Prune()
)

Exported for testing.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL