Documentation ¶
Index ¶
- Constants
- Variables
- func NodeMetadata(r report.Report, n report.Node) []report.MetadataRow
- func NodeMetrics(r report.Report, n report.Node) []report.MetricRow
- func NodeTables(r report.Report, n report.Node) []report.Table
- type Column
- type Connection
- type ConnectionsSummary
- type ControlInstance
- type Diff
- type Node
- type NodeSummaries
- type NodeSummary
- type NodeSummaryGroup
- type Parent
Constants ¶
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 ¶
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 ¶
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 ¶
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.
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 ¶
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.
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.