detailed

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 17 Imported by: 20

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: "number"},
		{ID: countKey, Label: countLabel, Datatype: "number", DefaultSort: true},
	}
	InternetColumns = []Column{
		{ID: remoteKey, Label: remoteLabel},
		{ID: portKey, Label: portLabel, Datatype: "number"},
		{ID: countKey, Label: countLabel, Datatype: "number", DefaultSort: true},
	}
)

Exported for testing

Functions

func NodeMetadata

func NodeMetadata(r report.Report, n report.Node) []report.MetadataRow

NodeMetadata produces a table (to be consumed directly by the UI) based on an a report.Node, which is (hopefully) a node in one of our topologies.

func NodeMetrics

func NodeMetrics(r report.Report, n report.Node) []report.MetricRow

NodeMetrics produces a table (to be consumed directly by the UI) based on an a report.Node, which is (hopefully) a node in one of our topologies.

func NodeTables added in v0.15.0

func NodeTables(r report.Report, n report.Node) []report.Table

NodeTables produces a list of tables (to be consumed directly by the UI) based on the report and the node. It uses the report to get the templates for the node's topology.

Types

type Column added in v0.13.0

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 added in v0.14.0

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"`
	Linkable   bool                 `json:"linkable"`
	Metadata   []report.MetadataRow `json:"metadata,omitempty"`
}

Connection is a row in the connections table.

type ConnectionsSummary added in v0.14.0

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 added in v0.13.0

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

CodecDecodeSelf implements codec.Selfer

func (*ControlInstance) CodecEncodeSelf added in v0.13.0

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 added in v0.13.0

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

MarshalJSON shouldn't be used, use CodecEncodeSelf instead

func (*ControlInstance) UnmarshalJSON added in v0.13.0

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

UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead

type Diff added in v0.14.0

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 added in v0.14.0

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 MakeNode

func MakeNode(topologyID string, rc report.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 added in v0.14.0

type NodeSummaries map[string]NodeSummary

NodeSummaries is a set of NodeSummaries indexed by ID.

func Summaries added in v0.14.0

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

Summaries converts RenderableNodes into a set of NodeSummaries

type NodeSummary

type NodeSummary struct {
	ID         string               `json:"id"`
	Label      string               `json:"label"`
	LabelMinor string               `json:"labelMinor"`
	Rank       string               `json:"rank"`
	Shape      string               `json:"shape,omitempty"`
	Stack      bool                 `json:"stack,omitempty"`
	Linkable   bool                 `json:"linkable,omitempty"` // Whether this node can be linked-to
	Pseudo     bool                 `json:"pseudo,omitempty"`
	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 child for a Node.

func MakeNodeSummary

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

MakeNodeSummary summarizes a node, if possible.

func RenderMetricURLs added in v1.6.3

func RenderMetricURLs(summary NodeSummary, n report.Node, 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 added in v0.14.0

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 added in v0.13.0

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

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

Jump to

Keyboard shortcuts

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