detailed

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Label added in v0.13.0

func Label(key string) string

Label maps from the internal keys to the human-readable label for a piece of metadata/set/etc. If none is found the raw key will be returned.

Types

type Column added in v0.13.0

type Column string

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

func (*Column) CodecDecodeSelf added in v0.13.0

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

CodecDecodeSelf implements codec.Selfer

func (*Column) CodecEncodeSelf added in v0.13.0

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

CodecEncodeSelf implements codec.Selfer

func (Column) MarshalJSON added in v0.13.0

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

MarshalJSON shouldn't be used, use CodecEncodeSelf instead

func (*Column) UnmarshalJSON added in v0.13.0

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

UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead

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

type Counter struct {
	ID    string
	Prime bool
}

Counter extracts some metadata rows from a node's Counters

func (Counter) MetadataRows added in v0.13.0

func (c Counter) MetadataRows(n report.Node) []MetadataRow

MetadataRows implements MetadataRowTemplate

type Latest added in v0.13.0

type Latest struct {
	ID       string
	Truncate int  // If > 0, truncate the value to this length.
	Prime    bool // Whether the row should be shown by default
}

Latest extracts some metadata rows from a node's Latest

func (Latest) MetadataRows added in v0.13.0

func (l Latest) MetadataRows(n report.Node) []MetadataRow

MetadataRows implements MetadataRowTemplate

type MetadataRow

type MetadataRow struct {
	ID    string
	Value string
	Prime bool
}

MetadataRow is a row for the metadata table.

func NodeDockerLabels added in v0.13.0

func NodeDockerLabels(nmd report.Node) []MetadataRow

NodeDockerLabels produces a table (to be consumed directly by the UI) based on an origin ID, which is (optimistically) a node ID in one of our topologies.

func NodeMetadata

func NodeMetadata(n report.Node) []MetadataRow

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

func (*MetadataRow) CodecDecodeSelf added in v0.13.0

func (m *MetadataRow) CodecDecodeSelf(decoder *codec.Decoder)

CodecDecodeSelf implements codec.Selfer

func (*MetadataRow) CodecEncodeSelf added in v0.13.0

func (m *MetadataRow) CodecEncodeSelf(encoder *codec.Encoder)

CodecEncodeSelf marshals this MetadataRow. It adds a label before rendering.

func (MetadataRow) Copy

func (m MetadataRow) Copy() MetadataRow

Copy returns a value copy of a metadata row.

func (MetadataRow) MarshalJSON added in v0.13.0

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

MarshalJSON shouldn't be used, use CodecEncodeSelf instead

func (*MetadataRow) UnmarshalJSON added in v0.13.0

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

UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead

type MetadataRowTemplate added in v0.13.0

type MetadataRowTemplate interface {
	MetadataRows(report.Node) []MetadataRow
}

MetadataRowTemplate extracts some metadata rows from a node

type MetricRow

type MetricRow struct {
	ID     string
	Format string
	Group  string
	Value  float64
	Metric *report.Metric
}

MetricRow is a tuple of data used to render a metric as a sparkline and accoutrements.

func NodeMetrics

func NodeMetrics(n report.Node) []MetricRow

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

func (*MetricRow) CodecDecodeSelf added in v0.13.0

func (m *MetricRow) CodecDecodeSelf(decoder *codec.Decoder)

CodecDecodeSelf implements codec.Selfer

func (*MetricRow) CodecEncodeSelf added in v0.13.0

func (m *MetricRow) CodecEncodeSelf(encoder *codec.Encoder)

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

func (MetricRow) Copy

func (m MetricRow) Copy() MetricRow

Copy returns a value copy of the MetricRow

func (MetricRow) MarshalJSON

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

MarshalJSON shouldn't be used, use CodecEncodeSelf instead

func (*MetricRow) UnmarshalJSON added in v0.13.0

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

UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead

type Node

type Node struct {
	NodeSummary
	Rank     string             `json:"rank,omitempty"`
	Pseudo   bool               `json:"pseudo,omitempty"`
	Controls []ControlInstance  `json:"controls"`
	Children []NodeSummaryGroup `json:"children,omitempty"`
	Parents  []Parent           `json:"parents,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(r report.Report, n render.RenderableNode) 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 NodeSummary

type NodeSummary struct {
	ID           string        `json:"id"`
	Label        string        `json:"label"`
	Linkable     bool          `json:"linkable"` // Whether this node can be linked-to
	Metadata     []MetadataRow `json:"metadata,omitempty"`
	DockerLabels []MetadataRow `json:"docker_labels,omitempty"`
	Metrics      []MetricRow   `json:"metrics,omitempty"`
}

NodeSummary is summary information about a child for a Node.

func MakeNodeSummary

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

MakeNodeSummary summarizes a node, if possible.

func (NodeSummary) Copy

func (n NodeSummary) Copy() NodeSummary

Copy returns a value copy of the NodeSummary

type NodeSummaryGroup

type NodeSummaryGroup struct {
	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.

func (NodeSummaryGroup) Copy

Copy returns a value copy of the NodeSummaryGroup

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 render.RenderableNode) (result []Parent)

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

type Set added in v0.13.0

type Set struct {
	ID string
}

Set extracts some metadata rows from a node's Sets

func (Set) MetadataRows added in v0.13.0

func (s Set) MetadataRows(n report.Node) []MetadataRow

MetadataRows implements MetadataRowTemplate

Jump to

Keyboard shortcuts

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