detailed

package
v0.0.0-...-06e0152 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageNameNone = "<none>"

	// Keys we use to render container names
	AmazonECSContainerNameLabel  = "com.amazonaws.ecs.container-name"
	KubernetesContainerNameLabel = "io.kubernetes.container.name"
	MarathonAppIDEnv             = "MARATHON_APP_ID"
)

Shapes that are allowed

Variables

View Source
var (
	NormalColumns = []Column{
		{ID: portKey, Label: portLabel, Datatype: report.Number},
		{ID: countKey, Label: countLabel, Datatype: report.Number, DefaultSort: true},
	}
	InternetColumns = []Column{
		{ID: remoteKey, Label: remoteLabel},
		{ID: portKey, Label: portLabel, Datatype: report.Number},
		{ID: countKey, Label: countLabel, Datatype: report.Number, DefaultSort: true},
	}
)

Exported for testing

Functions

This section is empty.

Types

type BasicNodeSummary

type BasicNodeSummary struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	LabelMinor string `json:"labelMinor"`
	Rank       string `json:"rank"`
	Shape      string `json:"shape,omitempty"`
	Tag        string `json:"tag,omitempty"`
	Stack      bool   `json:"stack,omitempty"`
	Pseudo     bool   `json:"pseudo,omitempty"`
}

BasicNodeSummary is basic summary information about a Node, sufficient for rendering links to the node.

func MakeBasicNodeSummary

func MakeBasicNodeSummary(r report.Report, n report.Node) (BasicNodeSummary, bool)

MakeBasicNodeSummary returns a basic summary of a node, if possible. This summary is sufficient for rendering links to the node.

type Column

type Column struct {
	ID          string `json:"id"`
	Label       string `json:"label"`
	DefaultSort bool   `json:"defaultSort"`
	Datatype    string `json:"dataType"`
}

Column provides special json serialization for column ids, so they include their label for the frontend.

type Connection

type Connection struct {
	ID         string               `json:"id"`     // ID of this element in the UI.  Must be unique for a given ConnectionsSummary.
	NodeID     string               `json:"nodeId"` // ID of a node in the topology. Optional, must be set if linkable is true.
	Label      string               `json:"label"`
	LabelMinor string               `json:"labelMinor,omitempty"`
	Metadata   []report.MetadataRow `json:"metadata,omitempty"`
}

Connection is a row in the connections table.

type ConnectionsSummary

type ConnectionsSummary struct {
	ID          string       `json:"id"`
	TopologyID  string       `json:"topologyId"`
	Label       string       `json:"label"`
	Columns     []Column     `json:"columns"`
	Connections []Connection `json:"connections"`
}

ConnectionsSummary is the table of connection to/form a node

type ControlInstance

type ControlInstance struct {
	ProbeID string
	NodeID  string
	Control report.Control
}

ControlInstance contains a control description, and all the info needed to execute it.

func (*ControlInstance) CodecDecodeSelf

func (c *ControlInstance) CodecDecodeSelf(decoder *codec.Decoder)

CodecDecodeSelf implements codec.Selfer

func (*ControlInstance) CodecEncodeSelf

func (c *ControlInstance) CodecEncodeSelf(encoder *codec.Encoder)

CodecEncodeSelf marshals this ControlInstance. It takes the basic Metric rendering, then adds some row-specific fields.

func (ControlInstance) MarshalJSON

func (ControlInstance) MarshalJSON() ([]byte, error)

MarshalJSON shouldn't be used, use CodecEncodeSelf instead

func (*ControlInstance) UnmarshalJSON

func (*ControlInstance) UnmarshalJSON(b []byte) error

UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead

type Diff

type Diff struct {
	Add    []NodeSummary `json:"add"`
	Update []NodeSummary `json:"update"`
	Remove []string      `json:"remove"`
	Reset  bool          `json:"reset,omitempty"`
}

Diff is returned by TopoDiff. It represents the changes between two NodeSummary maps.

func TopoDiff

func TopoDiff(a, b NodeSummaries) Diff

TopoDiff gives you the diff to get from A to B.

type Node

type Node struct {
	NodeSummary
	Controls    []ControlInstance    `json:"controls"`
	Children    []NodeSummaryGroup   `json:"children,omitempty"`
	Connections []ConnectionsSummary `json:"connections,omitempty"`
}

Node is the data type that's yielded to the JavaScript layer when we want deep information about an individual node.

func CensorNode

func CensorNode(node Node, cfg report.CensorConfig) Node

CensorNode removes any sensitive data from a node.

func MakeNode

func MakeNode(topologyID string, rc RenderContext, ns report.Nodes, n report.Node) Node

MakeNode transforms a renderable node to a detailed node. It uses aggregate metadata, plus the set of origin node IDs, to produce tables.

type NodeSummaries

type NodeSummaries map[string]NodeSummary

NodeSummaries is a set of NodeSummaries indexed by ID.

func CensorNodeSummaries

func CensorNodeSummaries(summaries NodeSummaries, cfg report.CensorConfig) NodeSummaries

CensorNodeSummaries removes any sensitive data from a list of node summaries.

func Summaries

func Summaries(ctx context.Context, rc RenderContext, rns report.Nodes) NodeSummaries

Summaries converts RenderableNodes into a set of NodeSummaries

type NodeSummary

type NodeSummary struct {
	BasicNodeSummary
	Metadata  []report.MetadataRow `json:"metadata,omitempty"`
	Parents   []Parent             `json:"parents,omitempty"`
	Metrics   []report.MetricRow   `json:"metrics,omitempty"`
	Tables    []report.Table       `json:"tables,omitempty"`
	Adjacency report.IDList        `json:"adjacency,omitempty"`
}

NodeSummary is summary information about a Node.

func MakeNodeSummary

func MakeNodeSummary(rc RenderContext, n report.Node) (NodeSummary, bool)

MakeNodeSummary summarizes a node, if possible.

func RenderMetricURLs

func RenderMetricURLs(summary NodeSummary, n report.Node, r report.Report, metricsGraphURL string) NodeSummary

RenderMetricURLs sets respective URLs for metrics in a node summary. Missing metrics where we have a query for will be appended as an empty metric (no values or samples).

func (NodeSummary) SummarizeMetrics

func (n NodeSummary) SummarizeMetrics() NodeSummary

SummarizeMetrics returns a copy of the NodeSummary where the metrics are replaced with their summaries

type NodeSummaryGroup

type NodeSummaryGroup struct {
	ID         string        `json:"id"`
	Label      string        `json:"label"`
	Nodes      []NodeSummary `json:"nodes"`
	TopologyID string        `json:"topologyId"`
	Columns    []Column      `json:"columns"`
}

NodeSummaryGroup is a topology-typed group of children for a Node.

type Parent

type Parent struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	TopologyID string `json:"topologyId"`
}

Parent is the information needed to build a link to the parent of a Node.

func Parents

func Parents(r report.Report, n report.Node) []Parent

Parents renders the parents of this report.Node, which have been aggregated from the probe reports.

type RenderContext

type RenderContext struct {
	report.Report
	MetricsGraphURL string
}

RenderContext carries contextual data that is needed when rendering parts of the report.

Jump to

Keyboard shortcuts

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