Documentation ¶
Index ¶
- Constants
- Variables
- func AddLocalBridge(name string) error
- func ContainingIPv4Network(ips []net.IP) *net.IPNet
- func ExtractHostID(m Node) string
- func GetLocalNetworks() ([]*net.IPNet, error)
- func IsCommandEntry(key string) bool
- func IsEnvironmentVarsEntry(key string) bool
- func IsLoopback(address string) bool
- func LocalAddresses() ([]net.IP, error)
- func MakeAddressNodeID(hostID, address string) string
- func MakeECSServiceNodeID(cluster, serviceName string) string
- func MakeEndpointNodeID(hostID, namespaceID, address, port string) string
- func MakeOverlayNodeID(peerPrefix, peerName string) string
- func MakeProcessNodeID(hostID, pid string) string
- func MakeScopedAddressNodeID(scope, address string) string
- func MakeScopedEndpointNodeID(scope, address, port string) string
- func ParseAddressNodeID(addressNodeID string) (hostID, address string, ok bool)
- func ParseECSServiceNodeID(ecsServiceNodeID string) (cluster, serviceName string, ok bool)
- func ParseEndpointNodeID(endpointNodeID string) (scope, address, port string, ok bool)
- func ParseIP(s []byte, into []byte) net.IP
- func ParseNodeID(nodeID string) (id string, tag string, ok bool)
- func ParseOverlayNodeID(id string) (overlayPrefix string, peerName string)
- func ParseProcessNodeID(processNodeID string) (hostID, pid string, ok bool)
- func StripCommandArgs(command string) string
- func WithoutPrefix(s string, prefix string) (string, bool)
- type CensorConfig
- type Column
- type Control
- type Controls
- type Counters
- func (c Counters) Add(key string, value int) Counters
- func (c *Counters) CodecDecodeSelf(decoder *codec.Decoder)
- func (c *Counters) CodecEncodeSelf(encoder *codec.Encoder)
- func (c Counters) DeepEqual(d Counters) bool
- func (c Counters) Lookup(key string) (int, bool)
- func (Counters) MarshalJSON() ([]byte, error)
- func (c Counters) Merge(other Counters) Counters
- func (c Counters) Size() int
- func (c Counters) String() string
- func (*Counters) UnmarshalJSON(b []byte) error
- type DNSRecord
- type DNSRecords
- type IDList
- type MetadataRow
- type MetadataRowsByPriority
- type MetadataTemplate
- type MetadataTemplates
- type Metric
- func (m *Metric) CodecDecodeSelf(decoder *codec.Decoder)
- func (m *Metric) CodecEncodeSelf(encoder *codec.Encoder)
- func (m Metric) LastSample() (Sample, bool)
- func (m Metric) Len() int
- func (Metric) MarshalJSON() ([]byte, error)
- func (m Metric) Merge(other Metric) Metric
- func (m Metric) ToIntermediate() WireMetrics
- func (*Metric) UnmarshalJSON(b []byte) error
- func (m Metric) WithMax(max float64) Metric
- type MetricRow
- type MetricRowsByPriority
- type MetricTemplate
- type MetricTemplates
- type Metrics
- type Networks
- type Node
- func (node Node) AddPrefixMulticolumnTable(prefix string, rows []Row) Node
- func (node Node) AddPrefixPropertyList(prefix string, propertyList map[string]string) Node
- func (n Node) After(other Node) bool
- func (n Node) Before(other Node) bool
- func (n Node) Equal(other Node) bool
- func (node Node) ExtractMulticolumnTable(template TableTemplate) (rows []Row)
- func (node Node) ExtractPropertyList(template TableTemplate) (rows []Row)
- func (node Node) ExtractTable(template TableTemplate) (rows []Row, truncationCount int)
- func (n Node) Merge(other Node) Node
- func (n Node) PruneParents() Node
- func (n Node) WithAdjacent(a ...string) Node
- func (n Node) WithChild(child Node) Node
- func (n Node) WithChildren(children NodeSet) Node
- func (n Node) WithCounters(c map[string]int) Node
- func (n Node) WithID(id string) Node
- func (n Node) WithLatest(k string, ts time.Time, v string) Node
- func (n Node) WithLatestActiveControls(cs ...string) Node
- func (n Node) WithLatestControl(control string, ts time.Time, data NodeControlData) Node
- func (n Node) WithLatestControls(lcs map[string]NodeControlData) Node
- func (n Node) WithLatests(m map[string]string) Node
- func (n Node) WithMetric(key string, metric Metric) Node
- func (n Node) WithMetrics(metrics Metrics) Node
- func (n Node) WithParent(key, parent string) Node
- func (n Node) WithParents(parents Sets) Node
- func (n Node) WithSet(key string, set StringSet) Node
- func (n Node) WithSets(sets Sets) Node
- func (n Node) WithTopology(topology string) Node
- type NodeControlData
- type NodeControlDataLatestMap
- func (m *NodeControlDataLatestMap) CodecDecodeSelf(decoder *codec.Decoder)
- func (m NodeControlDataLatestMap) CodecEncodeSelf(encoder *codec.Encoder)
- func (m NodeControlDataLatestMap) DeepEqual(n NodeControlDataLatestMap) bool
- func (m NodeControlDataLatestMap) ForEach(fn func(k string, timestamp time.Time, v NodeControlData))
- func (m NodeControlDataLatestMap) Lookup(key string) (NodeControlData, bool)
- func (m NodeControlDataLatestMap) LookupEntry(key string) (NodeControlData, time.Time, bool)
- func (NodeControlDataLatestMap) MarshalJSON() ([]byte, error)
- func (m NodeControlDataLatestMap) Merge(n NodeControlDataLatestMap) NodeControlDataLatestMap
- func (m NodeControlDataLatestMap) Set(key string, timestamp time.Time, value NodeControlData) NodeControlDataLatestMap
- func (m NodeControlDataLatestMap) Size() int
- func (m NodeControlDataLatestMap) String() string
- func (*NodeControlDataLatestMap) UnmarshalJSON(b []byte) error
- type NodeControls
- func (nc NodeControls) Add(ids ...string) NodeControls
- func (nc *NodeControls) CodecDecodeSelf(decoder *codec.Decoder)
- func (nc *NodeControls) CodecEncodeSelf(encoder *codec.Encoder)
- func (NodeControls) MarshalJSON() ([]byte, error)
- func (nc NodeControls) Merge(other NodeControls) NodeControls
- func (*NodeControls) UnmarshalJSON(b []byte) error
- type NodeSet
- func (n NodeSet) Add(nodes ...Node) NodeSet
- func (n *NodeSet) CodecDecodeSelf(decoder *codec.Decoder)
- func (n *NodeSet) CodecEncodeSelf(encoder *codec.Encoder)
- func (n NodeSet) Copy() NodeSet
- func (n NodeSet) DeepEqual(o NodeSet) bool
- func (n NodeSet) Delete(ids ...string) NodeSet
- func (n NodeSet) ForEach(f func(Node))
- func (n NodeSet) Lookup(key string) (Node, bool)
- func (NodeSet) MarshalJSON() ([]byte, error)
- func (n NodeSet) Merge(other NodeSet) NodeSet
- func (n NodeSet) Size() int
- func (n NodeSet) String() string
- func (*NodeSet) UnmarshalJSON(b []byte) error
- func (n *NodeSet) UnsafeAdd(node Node)
- func (n *NodeSet) UnsafeMerge(other NodeSet)
- type Nodes
- type Report
- func (r Report) Copy() Report
- func (r Report) DropTopologiesOver(limit int) Report
- func (r Report) Merge(other Report) Report
- func (rep *Report) ReadBinary(ctx context.Context, r io.Reader, gzipped bool, codecHandle codec.Handle) error
- func (rep *Report) ReadBytes(buf []byte, codecHandle codec.Handle) error
- func (r Report) Topology(name string) (Topology, bool)
- func (r *Report) UnsafeMerge(other Report)
- func (r Report) Upgrade() Report
- func (r Report) Validate() error
- func (r *Report) WalkNamedTopologies(f func(string, *Topology))
- func (r *Report) WalkPairedTopologies(o *Report, f func(*Topology, *Topology))
- func (r *Report) WalkTopologies(f func(*Topology))
- func (rep Report) WriteBinary() (*bytes.Buffer, error)
- func (rep *Report) WriteToFile(path string) error
- type Row
- type Sample
- type Sampling
- type Sets
- func (s Sets) Add(key string, value StringSet) Sets
- func (s Sets) AddString(key string, str string) Sets
- func (s *Sets) CodecDecodeSelf(decoder *codec.Decoder)
- func (s *Sets) CodecEncodeSelf(encoder *codec.Encoder)
- func (s Sets) DeepEqual(t Sets) bool
- func (s Sets) Delete(key string) Sets
- func (s Sets) Keys() []string
- func (s Sets) Lookup(key string) (StringSet, bool)
- func (Sets) MarshalJSON() ([]byte, error)
- func (s Sets) Merge(other Sets) Sets
- func (s Sets) Size() int
- func (s Sets) String() string
- func (*Sets) UnmarshalJSON(b []byte) error
- type StdoutPublisher
- type StringLatestMap
- func (m *StringLatestMap) CodecDecodeSelf(decoder *codec.Decoder)
- func (m StringLatestMap) CodecEncodeSelf(encoder *codec.Encoder)
- func (m StringLatestMap) DeepEqual(n StringLatestMap) bool
- func (m StringLatestMap) ForEach(fn func(k string, timestamp time.Time, v string))
- func (m StringLatestMap) Len() int
- func (m StringLatestMap) Less(i, j int) bool
- func (m StringLatestMap) Lookup(key string) (string, bool)
- func (m StringLatestMap) LookupEntry(key string) (string, time.Time, bool)
- func (StringLatestMap) MarshalJSON() ([]byte, error)
- func (m StringLatestMap) Merge(n StringLatestMap) StringLatestMap
- func (m StringLatestMap) Propagate(from StringLatestMap, keys ...string) StringLatestMap
- func (m StringLatestMap) Set(key string, timestamp time.Time, value string) StringLatestMap
- func (m StringLatestMap) Size() int
- func (m StringLatestMap) String() string
- func (m StringLatestMap) Swap(i, j int)
- func (*StringLatestMap) UnmarshalJSON(b []byte) error
- type StringSet
- type Table
- type TableTemplate
- type TableTemplates
- type Topology
- func (t Topology) AddNode(node Node)
- func (t Topology) Copy() Topology
- func (t Topology) GetShape() string
- func (t Topology) Merge(other Topology) Topology
- func (t Topology) ReplaceNode(node Node)
- func (t *Topology) UnsafeMerge(other Topology)
- func (t Topology) Validate() error
- func (t Topology) WithLabel(label, labelPlural string) Topology
- func (t Topology) WithMetadataTemplates(other MetadataTemplates) Topology
- func (t Topology) WithMetricTemplates(other MetricTemplates) Topology
- func (t Topology) WithShape(shape string) Topology
- func (t Topology) WithTableTemplates(other TableTemplates) Topology
- func (t Topology) WithTag(tag string) Topology
- type WireMetrics
Constants ¶
const ( // DateTime is an ISO timestamp of the format "2017-07-03T09:45:00.329067309Z" DateTime = "datetime" // Duration specified in seconds, e.g. "3600" means one hour Duration = "duration" // IP is a string in the format "182.43.147.201" IP = "ip" // Number as an integer or a floating point Number = "number" )
const ( // ScopeDelim is a general-purpose delimiter used within node IDs to // separate different contextual scopes. Different topologies have // different key structures. ScopeDelim = ";" // EdgeDelim separates two node IDs when they need to exist in the same key. // Concretely, it separates node IDs in keys that represent edges. EdgeDelim = "|" // Key added to nodes to prevent them being joined with conntracked connections DoesNotMakeConnections = "does_not_make_connections" // WeaveOverlayPeerPrefix is the prefix for weave peers in the overlay network WeaveOverlayPeerPrefix = "" // DockerOverlayPeerPrefix is the prefix for docker peers in the overlay network DockerOverlayPeerPrefix = "docker_peer_" )
Delimiters are used to separate parts of node IDs, to guarantee uniqueness in particular contexts.
const ( // probe/endpoint ReverseDNSNames = "reverse_dns_names" SnoopedDNSNames = "snooped_dns_names" CopyOf = "copy_of" // probe/process PID = "pid" Name = "name" // also used by probe/docker PPID = "ppid" Cmdline = "cmdline" Threads = "threads" // probe/docker DockerContainerID = "docker_container_id" DockerImageID = "docker_image_id" DockerImageName = "docker_image_name" DockerImageTag = "docker_image_tag" DockerImageSize = "docker_image_size" DockerImageVirtualSize = "docker_image_virtual_size" DockerIsInHostNetwork = "docker_is_in_host_network" DockerServiceName = "service_name" DockerStackNamespace = "stack_namespace" DockerStopContainer = "docker_stop_container" DockerStartContainer = "docker_start_container" DockerRestartContainer = "docker_restart_container" DockerPauseContainer = "docker_pause_container" DockerUnpauseContainer = "docker_unpause_container" DockerRemoveContainer = "docker_remove_container" DockerAttachContainer = "docker_attach_container" DockerExecContainer = "docker_exec_container" DockerContainerName = "docker_container_name" DockerContainerCommand = "docker_container_command" DockerContainerPorts = "docker_container_ports" DockerContainerCreated = "docker_container_created" DockerContainerNetworks = "docker_container_networks" DockerContainerIPs = "docker_container_ips" DockerContainerHostname = "docker_container_hostname" DockerContainerIPsWithScopes = "docker_container_ips_with_scopes" DockerContainerState = "docker_container_state" DockerContainerStateHuman = "docker_container_state_human" DockerContainerUptime = "docker_container_uptime" DockerContainerRestartCount = "docker_container_restart_count" DockerContainerNetworkMode = "docker_container_network_mode" DockerEnvPrefix = "docker_env_" // probe/kubernetes KubernetesName = "kubernetes_name" KubernetesNamespace = "kubernetes_namespace" KubernetesCreated = "kubernetes_created" KubernetesIP = "kubernetes_ip" KubernetesObservedGeneration = "kubernetes_observed_generation" KubernetesReplicas = "kubernetes_replicas" KubernetesDesiredReplicas = "kubernetes_desired_replicas" KubernetesNodeType = "kubernetes_node_type" KubernetesGetLogs = "kubernetes_get_logs" KubernetesDeletePod = "kubernetes_delete_pod" KubernetesScaleUp = "kubernetes_scale_up" KubernetesScaleDown = "kubernetes_scale_down" KubernetesUpdatedReplicas = "kubernetes_updated_replicas" KubernetesAvailableReplicas = "kubernetes_available_replicas" KubernetesStrategy = "kubernetes_strategy" KubernetesFullyLabeledReplicas = "kubernetes_fully_labeled_replicas" KubernetesState = "kubernetes_state" KubernetesIsInHostNetwork = "kubernetes_is_in_host_network" KubernetesRestartCount = "kubernetes_restart_count" KubernetesMisscheduledReplicas = "kubernetes_misscheduled_replicas" KubernetesPublicIP = "kubernetes_public_ip" KubernetesSchedule = "kubernetes_schedule" KubernetesSuspended = "kubernetes_suspended" KubernetesLastScheduled = "kubernetes_last_scheduled" KubernetesActiveJobs = "kubernetes_active_jobs" KubernetesType = "kubernetes_type" KubernetesPorts = "kubernetes_ports" KubernetesVolumeClaim = "kubernetes_volume_claim" KubernetesStorageClassName = "kubernetes_storage_class_name" KubernetesAccessModes = "kubernetes_access_modes" KubernetesReclaimPolicy = "kubernetes_reclaim_policy" KubernetesStatus = "kubernetes_status" KubernetesMessage = "kubernetes_message" KubernetesVolumeName = "kubernetes_volume_name" KubernetesProvisioner = "kubernetes_provisioner" KubernetesStorageDriver = "kubernetes_storage_driver" KubernetesVolumeSnapshotName = "kubernetes_volume_snapshot_name" KubernetesSnapshotData = "kuberneets_snapshot_data" KubernetesCreateVolumeSnapshot = "kubernetes_create_volume_snapshot" KubernetesVolumeCapacity = "kubernetes_volume_capacity" KubernetesCloneVolumeSnapshot = "kubernetes_clone_volume_snapshot" KubernetesDeleteVolumeSnapshot = "kubernetes_delete_volume_snapshot" KubernetesDescribe = "kubernetes_describe" // probe/awsecs ECSCluster = "ecs_cluster" ECSCreatedAt = "ecs_created_at" ECSTaskFamily = "ecs_task_family" ECSServiceDesiredCount = "ecs_service_desired_count" ECSServiceRunningCount = "ecs_service_running_count" ECSScaleUp = "ecs_scale_up" ECSScaleDown = "ecs_scale_down" )
node metadata keys
const ( FromLatest = "latest" FromSets = "sets" FromCounters = "counters" )
FromLatest and friends denote the different fields where metadata can be gathered from.
const ( DefaultFormat = "" FilesizeFormat = "filesize" IntegerFormat = "integer" PercentFormat = "percent" )
DefaultFormat and friends tell the UI how to render the "Value" of this metric.
const ( Endpoint = "endpoint" Process = "process" Container = "container" Pod = "pod" Service = "service" Deployment = "deployment" ReplicaSet = "replica_set" DaemonSet = "daemon_set" StatefulSet = "stateful_set" CronJob = "cron_job" Namespace = "namespace" ContainerImage = "container_image" Host = "host" Overlay = "overlay" ECSService = "ecs_service" ECSTask = "ecs_task" SwarmService = "swarm_service" PersistentVolume = "persistent_volume" PersistentVolumeClaim = "persistent_volume_claim" StorageClass = "storage_class" VolumeSnapshot = "volume_snapshot" VolumeSnapshotData = "volume_snapshot_data" Job = "job" // Shapes used for different nodes Circle = "circle" Triangle = "triangle" Square = "square" Pentagon = "pentagon" Hexagon = "hexagon" Heptagon = "heptagon" Octagon = "octagon" Cloud = "cloud" Cylinder = "cylinder" DottedCylinder = "dottedcylinder" StorageSheet = "sheet" Camera = "camera" DottedTriangle = "dottedtriangle" // Used when counting the number of containers ContainersKey = "containers" )
Names of the various topologies.
const ( // HostNodeID is a metadata foreign key, linking a node in any topology to // a node in the host topology. That host node is the origin host, where // the node was originally detected. HostNodeID = "host_node_id" // ControlProbeID is the random ID of the probe which controls the specific node. ControlProbeID = "control_probe_id" )
const ( MulticolumnTableType = "multicolumn-table" PropertyListType = "property-list" )
Table types
Variables ¶
var ( // MakeHostNodeID produces a host node ID from its composite parts. MakeHostNodeID = makeSingleComponentID("host") // ParseHostNodeID parses a host node ID ParseHostNodeID = parseSingleComponentID("host") // MakeContainerNodeID produces a container node ID from its composite parts. MakeContainerNodeID = makeSingleComponentID("container") // ParseContainerNodeID parses a container node ID ParseContainerNodeID = parseSingleComponentID("container") // MakeContainerImageNodeID produces a container image node ID from its composite parts. MakeContainerImageNodeID = makeSingleComponentID("container_image") // ParseContainerImageNodeID parses a container image node ID ParseContainerImageNodeID = parseSingleComponentID("container_image") // MakePodNodeID produces a pod node ID from its composite parts. MakePodNodeID = makeSingleComponentID("pod") // ParsePodNodeID parses a pod node ID ParsePodNodeID = parseSingleComponentID("pod") // MakeServiceNodeID produces a service node ID from its composite parts. MakeServiceNodeID = makeSingleComponentID("service") // ParseServiceNodeID parses a service node ID ParseServiceNodeID = parseSingleComponentID("service") // MakeDeploymentNodeID produces a deployment node ID from its composite parts. MakeDeploymentNodeID = makeSingleComponentID("deployment") // ParseDeploymentNodeID parses a deployment node ID ParseDeploymentNodeID = parseSingleComponentID("deployment") // MakeReplicaSetNodeID produces a replica set node ID from its composite parts. MakeReplicaSetNodeID = makeSingleComponentID("replica_set") // ParseReplicaSetNodeID parses a replica set node ID ParseReplicaSetNodeID = parseSingleComponentID("replica_set") // MakeDaemonSetNodeID produces a replica set node ID from its composite parts. MakeDaemonSetNodeID = makeSingleComponentID("daemonset") // ParseDaemonSetNodeID parses a daemon set node ID ParseDaemonSetNodeID = parseSingleComponentID("daemonset") // MakeStatefulSetNodeID produces a statefulset node ID from its composite parts. MakeStatefulSetNodeID = makeSingleComponentID("statefulset") // ParseStatefulSetNodeID parses a statefulset node ID ParseStatefulSetNodeID = parseSingleComponentID("statefulset") // MakeCronJobNodeID produces a cronjob node ID from its composite parts. MakeCronJobNodeID = makeSingleComponentID("cronjob") // ParseCronJobNodeID parses a cronjob node ID ParseCronJobNodeID = parseSingleComponentID("cronjob") // MakeJobNodeID produces a job node ID from its composite parts. MakeJobNodeID = makeSingleComponentID("job") // ParseJobNodeID parses a job node ID ParseJobNodeID = parseSingleComponentID("job") // MakeNamespaceNodeID produces a namespace node ID from its composite parts. MakeNamespaceNodeID = makeSingleComponentID("namespace") // ParseNamespaceNodeID parses a namespace set node ID ParseNamespaceNodeID = parseSingleComponentID("namespace") // MakeECSTaskNodeID produces a ECSTask node ID from its composite parts. MakeECSTaskNodeID = makeSingleComponentID("ecs_task") // ParseECSTaskNodeID parses a ECSTask node ID ParseECSTaskNodeID = parseSingleComponentID("ecs_task") // MakeSwarmServiceNodeID produces a Swarm service node ID from its composite parts. MakeSwarmServiceNodeID = makeSingleComponentID("swarm_service") // ParseSwarmServiceNodeID parses a Swarm service node ID ParseSwarmServiceNodeID = parseSingleComponentID("swarm_service") // MakePersistentVolumeNodeID produces a Persistent Volume node ID from its composite parts. MakePersistentVolumeNodeID = makeSingleComponentID("persistent_volume") // ParsePersistentVolumeNodeID parses a Persistent Volume node ID ParsePersistentVolumeNodeID = parseSingleComponentID("persistent_volume") // MakePersistentVolumeClaimNodeID produces a Persistent Volume Claim node ID from its composite parts. MakePersistentVolumeClaimNodeID = makeSingleComponentID("persistent_volume_claim") // ParsePersistentVolumeClaimNodeID parses a Persistent Volume Claim node ID ParsePersistentVolumeClaimNodeID = parseSingleComponentID("persistent_volume_claim") // MakeStorageClassNodeID produces a storage class node ID from its composite parts. MakeStorageClassNodeID = makeSingleComponentID("storage_class") // ParseStorageClassNodeID parses a storage class node ID ParseStorageClassNodeID = parseSingleComponentID("storage_class") // MakeVolumeSnapshotNodeID produces a volume snapshot node ID from its composite parts. MakeVolumeSnapshotNodeID = makeSingleComponentID("volume_snapshot") // ParseVolumeSnapshotNodeID parses a volume snapshot node ID ParseVolumeSnapshotNodeID = parseSingleComponentID("volume_snapshot") // MakeVolumeSnapshotDataNodeID produces a volume snapshot data node ID from its composite parts. MakeVolumeSnapshotDataNodeID = makeSingleComponentID("volume_snapshot_data") // ParseVolumeSnapshotDataNodeID parses a volume snapshot data node ID ParseVolumeSnapshotDataNodeID = parseSingleComponentID("volume_snapshot_data") )
var LocalNetworks = MakeNetworks()
LocalNetworks helps in determining which addresses a probe reports as being host-scoped.
TODO this design is broken, make it consistent with probe networks.
Functions ¶
func AddLocalBridge ¶
AddLocalBridge records the subnet address associated with the bridge name supplied, such that MakeAddressNodeID will scope addresses in this subnet as local.
func ContainingIPv4Network ¶
ContainingIPv4Network determines the smallest network containing the given IPv4 addresses. When no addresses are specified, nil is returned.
func GetLocalNetworks ¶
GetLocalNetworks returns all the local networks.
func IsCommandEntry ¶
IsCommandEntry returns true iff the entry comes from a command line that might need to be conditionally censored.
func IsEnvironmentVarsEntry ¶
IsEnvironmentVarsEntry returns true if the entry might expose some environment variables data might need to be conditionally censored.
func IsLoopback ¶
IsLoopback ascertains if an address comes from a loopback interface.
func LocalAddresses ¶
LocalAddresses returns a list of the local IP addresses.
func MakeAddressNodeID ¶
MakeAddressNodeID produces an address node ID from its composite parts.
func MakeECSServiceNodeID ¶
MakeECSServiceNodeID produces an ECS Service node ID from its composite parts.
func MakeEndpointNodeID ¶
MakeEndpointNodeID produces an endpoint node ID from its composite parts.
func MakeOverlayNodeID ¶
MakeOverlayNodeID produces an overlay topology node ID from a router peer's prefix and name, which is assumed to be globally unique.
func MakeProcessNodeID ¶
MakeProcessNodeID produces a process node ID from its composite parts.
func MakeScopedAddressNodeID ¶
MakeScopedAddressNodeID is like MakeAddressNodeID, but it always prefixes the ID witha scope.
func MakeScopedEndpointNodeID ¶
MakeScopedEndpointNodeID is like MakeEndpointNodeID, but it always prefixes the ID with a scope.
func ParseAddressNodeID ¶
ParseAddressNodeID produces the host ID, address from an address node ID.
func ParseECSServiceNodeID ¶
ParseECSServiceNodeID produces the cluster, service name from an ECS Service node ID
func ParseEndpointNodeID ¶
ParseEndpointNodeID produces the scope, address, and port and remainder. Note that scope may be blank.
func ParseIP ¶
ParseIP parses s as an IP address into a byte slice if supplied, returning the result. (mostly copied from net.ParseIP, modified to save memory allocations)
func ParseNodeID ¶
ParseNodeID produces the id and tag of a single-component node ID.
func ParseOverlayNodeID ¶
ParseOverlayNodeID produces the overlay type and peer name.
func ParseProcessNodeID ¶
ParseProcessNodeID produces the host ID and PID from a process node ID.
func StripCommandArgs ¶
StripCommandArgs removes all the arguments from the command
Types ¶
type CensorConfig ¶
CensorConfig describes how probe reports should be censored when rendered through the API.
func GetCensorConfigFromRequest ¶
func GetCensorConfigFromRequest(req *http.Request) CensorConfig
GetCensorConfigFromRequest extracts censor config from request query params.
type Column ¶
type Column struct { ID string `json:"id"` Label string `json:"label"` DataType string `json:"dataType"` }
Column is the type for multi-column tables in the UI.
type Control ¶
type Control struct { ID string `json:"id"` Human string `json:"human"` Icon string `json:"icon"` // from https://fortawesome.github.io/Font-Awesome/cheatsheet/ please Confirmation string `json:"confirmation,omitempty"` Rank int `json:"rank"` }
A Control basically describes an RPC
type Controls ¶
Controls describe the control tags within the Nodes
func (Controls) AddControl ¶
AddControl adds c added to cs.
func (Controls) AddControls ¶
AddControls adds a collection of controls to cs.
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters is a string->int map.
func (*Counters) CodecDecodeSelf ¶
CodecDecodeSelf implements codec.Selfer
func (*Counters) CodecEncodeSelf ¶
CodecEncodeSelf implements codec.Selfer
func (Counters) MarshalJSON ¶
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (Counters) Merge ¶
Merge produces a fresh Counters, container the keys from both inputs. When both inputs container the same key, the latter value is used.
func (*Counters) UnmarshalJSON ¶
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
type DNSRecord ¶
type DNSRecord struct { Forward StringSet `json:"forward,omitempty"` Reverse StringSet `json:"reverse,omitempty"` }
DNSRecord contains names that an IP address maps to
type DNSRecords ¶
DNSRecords contains all address->name mappings for a report
func (DNSRecords) FirstMatch ¶
FirstMatch returns the first DNS name where match() returns true
func (DNSRecords) Merge ¶
func (r DNSRecords) Merge(other DNSRecords) DNSRecords
Merge merges the other object into this one, and returns the result object. The original is not modified.
type IDList ¶
type IDList StringSet
IDList is a list of string IDs, which are always sorted and unique.
func (IDList) Intersection ¶
Intersection returns the intersection of a and b
type MetadataRow ¶
type MetadataRow struct { ID string `json:"id"` Label string `json:"label"` Value string `json:"value"` Priority float64 `json:"priority,omitempty"` Datatype string `json:"dataType,omitempty"` Truncate int `json:"truncate,omitempty"` }
MetadataRow is a row for the metadata table.
type MetadataRowsByPriority ¶
type MetadataRowsByPriority []MetadataRow
MetadataRowsByPriority implements sort.Interface, so we can sort the rows by priority before rendering them to the UI.
func (MetadataRowsByPriority) Len ¶
func (m MetadataRowsByPriority) Len() int
Len is part of sort.Interface.
func (MetadataRowsByPriority) Less ¶
func (m MetadataRowsByPriority) Less(i, j int) bool
Less is part of sort.Interface.
func (MetadataRowsByPriority) Swap ¶
func (m MetadataRowsByPriority) Swap(i, j int)
Swap is part of sort.Interface.
type MetadataTemplate ¶
type MetadataTemplate struct { ID string `json:"id"` Label string `json:"label,omitempty"` // Human-readable descriptor for this row Truncate int `json:"truncate,omitempty"` // If > 0, truncate the value to this length. Datatype string `json:"dataType,omitempty"` Priority float64 `json:"priority,omitempty"` From string `json:"from,omitempty"` // Defines how to get the value from a report node }
MetadataTemplate extracts some metadata rows from a node
func (MetadataTemplate) MetadataRow ¶
func (t MetadataTemplate) MetadataRow(n Node) (MetadataRow, bool)
MetadataRow returns the row for a node
type MetadataTemplates ¶
type MetadataTemplates map[string]MetadataTemplate
MetadataTemplates is a mergeable set of metadata templates
func (MetadataTemplates) Copy ¶
func (e MetadataTemplates) Copy() MetadataTemplates
Copy returns a value copy of the metadata templates
func (MetadataTemplates) Merge ¶
func (e MetadataTemplates) Merge(other MetadataTemplates) MetadataTemplates
Merge merges two sets of MetadataTemplates so far just ignores based on duplicate id key
func (MetadataTemplates) MetadataRows ¶
func (e MetadataTemplates) MetadataRows(n Node) []MetadataRow
MetadataRows returns the rows for a node
type Metric ¶
Metric is a list of timeseries data with some metadata. Clients must use the Add method to add values. Metrics are immutable.
func MakeMetric ¶
MakeMetric makes a new Metric from unique samples incrementally ordered in time.
func MakeSingletonMetric ¶
MakeSingletonMetric makes a metric with a single value
func (*Metric) CodecDecodeSelf ¶
CodecDecodeSelf implements codec.Selfer
func (*Metric) CodecEncodeSelf ¶
CodecEncodeSelf implements codec.Selfer
func (Metric) LastSample ¶
LastSample obtains the last sample of the metric
func (Metric) MarshalJSON ¶
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (Metric) ToIntermediate ¶
func (m Metric) ToIntermediate() WireMetrics
ToIntermediate converts the metric to a representation suitable for serialization.
func (*Metric) UnmarshalJSON ¶
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
type MetricRow ¶
type MetricRow struct { ID string Label string Format string Group string Value float64 ValueEmpty bool Priority float64 URL string Metric *Metric }
MetricRow is a tuple of data used to render a metric as a sparkline and accoutrements.
func (*MetricRow) CodecDecodeSelf ¶
CodecDecodeSelf implements codec.Selfer
func (*MetricRow) CodecEncodeSelf ¶
CodecEncodeSelf marshals this MetricRow. It takes the basic Metric rendering, then adds some row-specific fields.
func (MetricRow) MarshalJSON ¶
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (MetricRow) Summary ¶
Summary returns a copy of the MetricRow, without the samples, just the value if there is one.
func (*MetricRow) UnmarshalJSON ¶
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
type MetricRowsByPriority ¶
type MetricRowsByPriority []MetricRow
MetricRowsByPriority implements sort.Interface, so we can sort the rows by priority before rendering them to the UI.
func (MetricRowsByPriority) Len ¶
func (m MetricRowsByPriority) Len() int
Len is part of sort.Interface.
func (MetricRowsByPriority) Less ¶
func (m MetricRowsByPriority) Less(i, j int) bool
Less is part of sort.Interface.
func (MetricRowsByPriority) Swap ¶
func (m MetricRowsByPriority) Swap(i, j int)
Swap is part of sort.Interface.
type MetricTemplate ¶
type MetricTemplate struct { ID string `json:"id"` Label string `json:"label,omitempty"` Format string `json:"format,omitempty"` Group string `json:"group,omitempty"` Priority float64 `json:"priority,omitempty"` }
MetricTemplate extracts a metric row from a node
type MetricTemplates ¶
type MetricTemplates map[string]MetricTemplate
MetricTemplates is a mergeable set of metric templates
func (MetricTemplates) Copy ¶
func (e MetricTemplates) Copy() MetricTemplates
Copy returns a value copy of the metadata templates
func (MetricTemplates) Merge ¶
func (e MetricTemplates) Merge(other MetricTemplates) MetricTemplates
Merge merges two sets of MetricTemplates so far just ignores based on duplicate id key
func (MetricTemplates) MetricRows ¶
func (e MetricTemplates) MetricRows(n Node) []MetricRow
MetricRows returns the rows for a node
type Metrics ¶
Metrics is a string->metric map.
type Networks ¶
Networks represent a set of subnets
func MakeNetworks ¶
func MakeNetworks() Networks
MakeNetworks creates a datastructure representing a set of networks.
type Node ¶
type Node struct { ID string `json:"id,omitempty"` Topology string `json:"topology,omitempty"` Counters Counters `json:"counters,omitempty"` Sets Sets `json:"sets,omitempty"` Adjacency IDList `json:"adjacency,omitempty"` LatestControls NodeControlDataLatestMap `json:"latestControls,omitempty"` Latest StringLatestMap `json:"latest,omitempty"` Metrics Metrics `json:"metrics,omitempty" deepequal:"nil==empty"` Parents Sets `json:"parents,omitempty"` Children NodeSet `json:"children,omitempty"` }
Node describes a superset of the metadata that probes can collect about a given node in a given topology, along with the edges (aka adjacency) emanating from the node.
func MakeNodeWith ¶
MakeNodeWith creates a new Node with the supplied map.
func (Node) AddPrefixMulticolumnTable ¶
AddPrefixMulticolumnTable appends arbitrary rows to the Node, returning a new node.
func (Node) AddPrefixPropertyList ¶
AddPrefixPropertyList appends arbitrary key-value pairs to the Node, returning a new node.
func (Node) ExtractMulticolumnTable ¶
func (node Node) ExtractMulticolumnTable(template TableTemplate) (rows []Row)
ExtractMulticolumnTable returns the rows to build a multicolumn table from this node
func (Node) ExtractPropertyList ¶
func (node Node) ExtractPropertyList(template TableTemplate) (rows []Row)
ExtractPropertyList returns the rows to build a property list from this node
func (Node) ExtractTable ¶
func (node Node) ExtractTable(template TableTemplate) (rows []Row, truncationCount int)
ExtractTable returns the rows to build either a property list or a generic table from this node. It also returns the number of rows, if any, that were truncated. The probes used to limit the number of labels, env vars and Weave Net connections they report, but this logic has since been removed. So the code here dealing with truncation is only retained in order to handle legacy reports.
func (Node) PruneParents ¶
PruneParents returns a fresh copy of n, without any parents.
func (Node) WithAdjacent ¶
WithAdjacent returns a fresh copy of n, with 'a' added to Adjacency
func (Node) WithChildren ¶
WithChildren returns a fresh copy of n, with children merged in.
func (Node) WithCounters ¶
WithCounters returns a fresh copy of n, with Counters c merged in.
func (Node) WithLatest ¶
WithLatest produces a new Node with k mapped to v in the Latest metadata.
func (Node) WithLatestActiveControls ¶
WithLatestActiveControls returns a fresh copy of n, with active controls cs added to LatestControls.
func (Node) WithLatestControl ¶
WithLatestControl produces a new Node with control added to it
func (Node) WithLatestControls ¶
func (n Node) WithLatestControls(lcs map[string]NodeControlData) Node
WithLatestControls returns a fresh copy of n, with lcs added to LatestControls.
func (Node) WithLatests ¶
WithLatests returns a fresh copy of n, with Metadata m merged in.
func (Node) WithMetric ¶
WithMetric returns a fresh copy of n, with metric merged in at key.
func (Node) WithMetrics ¶
WithMetrics returns a fresh copy of n, with metrics merged in.
func (Node) WithParent ¶
WithParent returns a fresh copy of n, with one parent added
func (Node) WithParents ¶
WithParents returns a fresh copy of n, with sets merged in.
func (Node) WithTopology ¶
WithTopology returns a fresh copy of n, with ID changed.
type NodeControlData ¶
type NodeControlData struct {
Dead bool `json:"dead"`
}
NodeControlData contains specific information about the control. It is used as a Value field of LatestEntry in NodeControlDataLatestMap.
type NodeControlDataLatestMap ¶
type NodeControlDataLatestMap []nodeControlDataLatestEntry
NodeControlDataLatestMap holds latest NodeControlData instances, as a slice sorted by key.
func MakeNodeControlDataLatestMap ¶
func MakeNodeControlDataLatestMap() NodeControlDataLatestMap
MakeNodeControlDataLatestMap makes an empty NodeControlDataLatestMap.
func (*NodeControlDataLatestMap) CodecDecodeSelf ¶
func (m *NodeControlDataLatestMap) CodecDecodeSelf(decoder *codec.Decoder)
CodecDecodeSelf implements codec.Selfer. Decodes the input as for a built-in map, without creating an intermediate copy of the data structure to save time. Uses undocumented, internal APIs as for CodecEncodeSelf.
func (NodeControlDataLatestMap) CodecEncodeSelf ¶
func (m NodeControlDataLatestMap) CodecEncodeSelf(encoder *codec.Encoder)
CodecEncodeSelf implements codec.Selfer. Duplicates the output for a built-in map without generating an intermediate copy of the data structure, to save time. Note this means we are using undocumented, internal APIs, which could break in the future. See https://github.com/weaveworks/scope/pull/1709 for more information.
func (NodeControlDataLatestMap) DeepEqual ¶
func (m NodeControlDataLatestMap) DeepEqual(n NodeControlDataLatestMap) bool
DeepEqual tests equality with other NodeControlDataLatestMap.
func (NodeControlDataLatestMap) ForEach ¶
func (m NodeControlDataLatestMap) ForEach(fn func(k string, timestamp time.Time, v NodeControlData))
ForEach executes fn on each key value pair in the map.
func (NodeControlDataLatestMap) Lookup ¶
func (m NodeControlDataLatestMap) Lookup(key string) (NodeControlData, bool)
Lookup the value for the given key.
func (NodeControlDataLatestMap) LookupEntry ¶
func (m NodeControlDataLatestMap) LookupEntry(key string) (NodeControlData, time.Time, bool)
LookupEntry returns the raw entry for the given key.
func (NodeControlDataLatestMap) MarshalJSON ¶
func (NodeControlDataLatestMap) MarshalJSON() ([]byte, error)
MarshalJSON shouldn't be used, use CodecEncodeSelf instead.
func (NodeControlDataLatestMap) Merge ¶
func (m NodeControlDataLatestMap) Merge(n NodeControlDataLatestMap) NodeControlDataLatestMap
Merge produces a NodeControlDataLatestMap containing the keys from both inputs. When both inputs contain the same key, the newer value is used. Tries to return one of its inputs, if that already holds the correct result.
func (NodeControlDataLatestMap) Set ¶
func (m NodeControlDataLatestMap) Set(key string, timestamp time.Time, value NodeControlData) NodeControlDataLatestMap
Set the value for the given key.
func (NodeControlDataLatestMap) Size ¶
func (m NodeControlDataLatestMap) Size() int
Size returns the number of elements.
func (NodeControlDataLatestMap) String ¶
func (m NodeControlDataLatestMap) String() string
String returns the NodeControlDataLatestMap's string representation.
func (*NodeControlDataLatestMap) UnmarshalJSON ¶
func (*NodeControlDataLatestMap) UnmarshalJSON(b []byte) error
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead.
type NodeControls ¶
NodeControls represent the individual controls that are valid for a given node at a given point in time. It's immutable. A zero-value for Timestamp indicated this NodeControls is 'not set'.
func MakeNodeControls ¶
func MakeNodeControls() NodeControls
MakeNodeControls makes a new NodeControls
func (NodeControls) Add ¶
func (nc NodeControls) Add(ids ...string) NodeControls
Add the new control IDs to this NodeControls, producing a fresh NodeControls.
func (*NodeControls) CodecDecodeSelf ¶
func (nc *NodeControls) CodecDecodeSelf(decoder *codec.Decoder)
CodecDecodeSelf implements codec.Selfer
func (*NodeControls) CodecEncodeSelf ¶
func (nc *NodeControls) CodecEncodeSelf(encoder *codec.Encoder)
CodecEncodeSelf implements codec.Selfer
func (NodeControls) MarshalJSON ¶
func (NodeControls) MarshalJSON() ([]byte, error)
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (NodeControls) Merge ¶
func (nc NodeControls) Merge(other NodeControls) NodeControls
Merge returns the newest of the two NodeControls; it does not take the union of the valid Controls.
func (*NodeControls) UnmarshalJSON ¶
func (*NodeControls) UnmarshalJSON(b []byte) error
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
type NodeSet ¶
type NodeSet struct {
// contains filtered or unexported fields
}
NodeSet is a set of nodes keyed on ID. Clients must use the Add method to add nodes
func MakeNodeSet ¶
MakeNodeSet makes a new NodeSet with the given nodes.
func (*NodeSet) CodecDecodeSelf ¶
CodecDecodeSelf implements codec.Selfer
func (*NodeSet) CodecEncodeSelf ¶
CodecEncodeSelf implements codec.Selfer
func (NodeSet) Delete ¶
Delete deletes the nodes from the NodeSet by ID. Delete is the only valid way to shrink a NodeSet. Delete returns the NodeSet to enable chaining.
func (NodeSet) MarshalJSON ¶
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (*NodeSet) UnmarshalJSON ¶
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
func (*NodeSet) UnsafeAdd ¶
UnsafeAdd adds a node to the NodeSet. Only call this if n has one owner.
func (*NodeSet) UnsafeMerge ¶
UnsafeMerge combines the two NodeSets, altering n
type Nodes ¶
Nodes is a collection of nodes in a topology. Keys are node IDs. TODO(pb): type Topology map[string]Node
func (Nodes) Merge ¶
Merge merges the other object into this one, and returns the result object. The original is not modified.
func (*Nodes) UnsafeMerge ¶
UnsafeMerge merges the other object into this one, modifying the original.
type Report ¶
type Report struct { // Endpoint nodes are individual (address, port) tuples on each host. // They come from inspecting active connections and can (theoretically) // be traced back to a process. Edges are present. Endpoint Topology // Process nodes are processes on each host. Edges are not present. Process Topology // Container nodes represent all Docker containers on hosts running probes. // Metadata includes things like containter id, name, image id etc. // Edges are not present. Container Topology // Pod nodes represent all Kubernetes pods running on hosts running probes. // Metadata includes things like pod id, name etc. Edges are not // present. Pod Topology // Service nodes represent all Kubernetes services running on hosts running probes. // Metadata includes things like service id, name etc. Edges are not // present. Service Topology // Deployment nodes represent all Kubernetes deployments running on hosts running probes. // Metadata includes things like deployment id, name etc. Edges are not // present. Deployment Topology // ReplicaSet nodes represent all Kubernetes ReplicaSets running on hosts running probes. // Metadata includes things like ReplicaSet id, name etc. Edges are not // present. ReplicaSet Topology // DaemonSet nodes represent all Kubernetes DaemonSets running on hosts running probes. // Metadata includes things like DaemonSet id, name etc. Edges are not // present. DaemonSet Topology // StatefulSet nodes represent all Kubernetes Stateful Sets running on hosts running probes. // Metadata includes things like Stateful Set id, name, etc. Edges are not // present. StatefulSet Topology // CronJob nodes represent all Kubernetes Cron Jobs running on hosts running probes. // Metadata includes things like Cron Job id, name, etc. Edges are not // present. CronJob Topology // Namespace nodes represent all Kubernetes Namespaces running on hosts running probes. // Metadata includes things like Namespace id, name, etc. Edges are not // present. Namespace Topology // ContainerImages nodes represent all Docker containers images on // hosts running probes. Metadata includes things like image id, name etc. // Edges are not present. ContainerImage Topology // Host nodes are physical hosts that run probes. Metadata includes things // like operating system, load, etc. The information is scraped by the // probes with each published report. Edges are not present. Host Topology // ECS Task nodes are AWS ECS tasks, which represent a group of containers. // Metadata is limited for now, more to come later. Edges are not present. ECSTask Topology // ECS Service nodes are AWS ECS services, which represent a specification for a // desired count of tasks with a task definition template. // Metadata is limited for now, more to come later. Edges are not present. ECSService Topology // Swarm Service nodes are Docker Swarm services, which represent a specification for a // group of tasks (either one per host, or a desired count). // Edges are not present. SwarmService Topology // Overlay nodes are active peers in any software-defined network that's // overlaid on the infrastructure. The information is scraped by polling // their status endpoints. Edges are present. Overlay Topology // Persistent Volume nodes represent all Kubernetes Persistent Volumes running on hosts running probes. // Metadata is limited for now, more to come later. PersistentVolume Topology // Persistent Volume Claim nodes represent all Kubernetes Persistent Volume Claims running on hosts running probes. // Metadata is limited for now, more to come later. PersistentVolumeClaim Topology // Storage Class represent all kubernetes Storage Classes on hosts running probes. // Metadata is limited for now, more to come later. StorageClass Topology // VolumeSnapshot represent all Kubernetes Volume Snapshots on hosts running probes. VolumeSnapshot Topology // VolumeSnapshotData represent all Kubernetes Volume Snapshot Data on hosts running probes. VolumeSnapshotData Topology // Job represent all Kubernetes Job on hosts running probes. Job Topology DNS DNSRecords // Sampling data for this report. Sampling Sampling // Window is the amount of time that this report purports to represent. // Windows must be carefully merged. They should only be added when // reports cover non-overlapping periods of time. By default, we assume // that's true, and add windows in merge operations. When that's not true, // such as in the app, we expect the component to overwrite the window // before serving it to consumers. Window time.Duration // Shortcut reports should be propagated to the UI as quickly as possible, // bypassing the usual spy interval, publish interval and app ws interval. Shortcut bool Plugins xfer.PluginSpecs // ID a random identifier for this report, used when caching // rendered views of the report. Reports with the same id // must be equal, but we don't require that equal reports have // the same id. ID string `deepequal:"skip"` }
Report is the core data type. It's produced by probes, and consumed and stored by apps. It's composed of multiple topologies, each representing a different (related, but not equivalent) view of the network.
func CensorRawReport ¶
func CensorRawReport(rawReport Report, cfg CensorConfig) Report
CensorRawReport removes any sensitive data from the raw report based on the request query params.
func MakeFromBinary ¶
MakeFromBinary constructs a Report from a gzipped msgpack.
func MakeFromBytes ¶
MakeFromBytes constructs a Report from a gzipped msgpack.
func MakeFromFile ¶
MakeFromFile construct a Report from a file, with the encoding determined by the extension (".msgpack" or ".json", with an optional ".gz").
func MakeReport ¶
func MakeReport() Report
MakeReport makes a clean report, ready to Merge() other reports into.
func (Report) DropTopologiesOver ¶
DropTopologiesOver - as a protection against overloading the app server, drop topologies that have really large node counts. In practice we only see this with runaway numbers of zombie processes.
func (Report) Merge ¶
Merge merges another Report into the receiver and returns the result. The original is not modified.
func (*Report) ReadBinary ¶
func (rep *Report) ReadBinary(ctx context.Context, r io.Reader, gzipped bool, codecHandle codec.Handle) error
ReadBinary reads bytes into a Report.
Will decompress the binary if gzipped is true, and will use the given codecHandle to decode it.
func (*Report) UnsafeMerge ¶
UnsafeMerge merges another Report into the receiver. The original is modified.
func (*Report) WalkNamedTopologies ¶
WalkNamedTopologies iterates through the Topologies of the report, potentially modifying them.
func (*Report) WalkPairedTopologies ¶
WalkPairedTopologies iterates through the Topologies of this and another report, potentially modifying one or both.
func (*Report) WalkTopologies ¶
WalkTopologies iterates through the Topologies of the report, potentially modifying them
func (Report) WriteBinary ¶
WriteBinary writes a Report as a gzipped msgpack into a bytes.Buffer
func (*Report) WriteToFile ¶
WriteToFile writes a Report to a file. The encoding is determined by the file extension (".msgpack" or ".json", with an optional ".gz").
type Row ¶
Row is the type that holds the table data for the UI. Entries map from column ID to cell value.
type Sampling ¶
Sampling describes how the packet data sources for this report were sampled. It can be used to calculate effective sample rates. We can't just put the rate here, because that can't be accurately merged. Counts in e.g. edge metadata structures have already been adjusted to compensate for the sample rate.
type Sets ¶
type Sets struct {
// contains filtered or unexported fields
}
Sets is a string->set-of-strings map. It is immutable.
func (Sets) AddString ¶
AddString adds a single string under a key, creating a new StringSet if necessary.
func (*Sets) CodecDecodeSelf ¶
CodecDecodeSelf implements codec.Selfer
func (*Sets) CodecEncodeSelf ¶
CodecEncodeSelf implements codec.Selfer
func (Sets) MarshalJSON ¶
MarshalJSON shouldn't be used, use CodecEncodeSelf instead
func (Sets) Merge ¶
Merge merges two sets maps into a fresh set, performing set-union merges as appropriate.
func (*Sets) UnmarshalJSON ¶
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead
type StdoutPublisher ¶
type StdoutPublisher struct{}
StdoutPublisher is useful when debugging
func (StdoutPublisher) Publish ¶
func (StdoutPublisher) Publish(rep Report) error
Publish implements probe.ReportPublisher
type StringLatestMap ¶
type StringLatestMap []stringLatestEntry
StringLatestMap holds latest string instances, as a slice sorted by key.
func MakeStringLatestMap ¶
func MakeStringLatestMap() StringLatestMap
MakeStringLatestMap makes an empty StringLatestMap.
func (*StringLatestMap) CodecDecodeSelf ¶
func (m *StringLatestMap) CodecDecodeSelf(decoder *codec.Decoder)
CodecDecodeSelf implements codec.Selfer. Decodes the input as for a built-in map, without creating an intermediate copy of the data structure to save time. Uses undocumented, internal APIs as for CodecEncodeSelf.
func (StringLatestMap) CodecEncodeSelf ¶
func (m StringLatestMap) CodecEncodeSelf(encoder *codec.Encoder)
CodecEncodeSelf implements codec.Selfer. Duplicates the output for a built-in map without generating an intermediate copy of the data structure, to save time. Note this means we are using undocumented, internal APIs, which could break in the future. See https://github.com/weaveworks/scope/pull/1709 for more information.
func (StringLatestMap) DeepEqual ¶
func (m StringLatestMap) DeepEqual(n StringLatestMap) bool
DeepEqual tests equality with other StringLatestMap.
func (StringLatestMap) ForEach ¶
func (m StringLatestMap) ForEach(fn func(k string, timestamp time.Time, v string))
ForEach executes fn on each key value pair in the map.
func (StringLatestMap) Len ¶
func (m StringLatestMap) Len() int
These let us sort a StringLatestMap strings by key
func (StringLatestMap) Less ¶
func (m StringLatestMap) Less(i, j int) bool
func (StringLatestMap) Lookup ¶
func (m StringLatestMap) Lookup(key string) (string, bool)
Lookup the value for the given key.
func (StringLatestMap) LookupEntry ¶
LookupEntry returns the raw entry for the given key.
func (StringLatestMap) MarshalJSON ¶
func (StringLatestMap) MarshalJSON() ([]byte, error)
MarshalJSON shouldn't be used, use CodecEncodeSelf instead.
func (StringLatestMap) Merge ¶
func (m StringLatestMap) Merge(n StringLatestMap) StringLatestMap
Merge produces a StringLatestMap containing the keys from both inputs. When both inputs contain the same key, the newer value is used. Tries to return one of its inputs, if that already holds the correct result.
func (StringLatestMap) Propagate ¶
func (m StringLatestMap) Propagate(from StringLatestMap, keys ...string) StringLatestMap
Propagate a set of latest values from one set to another.
func (StringLatestMap) Set ¶
func (m StringLatestMap) Set(key string, timestamp time.Time, value string) StringLatestMap
Set the value for the given key.
func (StringLatestMap) Size ¶
func (m StringLatestMap) Size() int
Size returns the number of elements.
func (StringLatestMap) String ¶
func (m StringLatestMap) String() string
String returns the StringLatestMap's string representation.
func (StringLatestMap) Swap ¶
func (m StringLatestMap) Swap(i, j int)
func (*StringLatestMap) UnmarshalJSON ¶
func (*StringLatestMap) UnmarshalJSON(b []byte) error
UnmarshalJSON shouldn't be used, use CodecDecodeSelf instead.
type StringSet ¶
type StringSet []string
StringSet is a sorted set of unique strings. Clients must use the Add method to add strings.
func MakeStringSet ¶
MakeStringSet makes a new StringSet with the given strings.
func (StringSet) Add ¶
Add adds the strings to the StringSet. Add is the only valid way to grow a StringSet. Add returns the StringSet to enable chaining.
func (StringSet) Intersection ¶
Intersection returns the intersections of a and b
type Table ¶
type Table struct { ID string `json:"id"` Label string `json:"label"` Type string `json:"type"` Columns []Column `json:"columns"` Rows []Row `json:"rows"` TruncationCount int `json:"truncationCount,omitempty"` }
Table is the type for a table in the UI.
type TableTemplate ¶
type TableTemplate struct { ID string `json:"id"` Label string `json:"label"` Prefix string `json:"prefix"` Type string `json:"type"` Columns []Column `json:"columns"` // FixedRows indicates what predetermined rows to render each entry is // indexed by the key to extract the row value is mapped to the row // label FixedRows map[string]string `json:"fixedRows"` }
TableTemplate describes how to render a table for the UI.
func (TableTemplate) Copy ¶
func (t TableTemplate) Copy() TableTemplate
Copy returns a value-copy of the TableTemplate
func (TableTemplate) Merge ¶
func (t TableTemplate) Merge(other TableTemplate) TableTemplate
Merge other into t, returning a fresh copy. Does fieldwise max - whilst this isn't particularly meaningful, at least it idempotent, commutativite and associative.
type TableTemplates ¶
type TableTemplates map[string]TableTemplate
TableTemplates is a mergeable set of TableTemplate
func (TableTemplates) Copy ¶
func (t TableTemplates) Copy() TableTemplates
Copy returns a value copy of the TableTemplates
func (TableTemplates) Merge ¶
func (t TableTemplates) Merge(other TableTemplates) TableTemplates
Merge merges two sets of TableTemplates
func (TableTemplates) Tables ¶
func (t TableTemplates) Tables(node Node) []Table
Tables renders the TableTemplates for a given node.
type Topology ¶
type Topology struct { Shape string `json:"shape,omitempty"` Tag string `json:"tag,omitempty"` Label string `json:"label,omitempty"` LabelPlural string `json:"label_plural,omitempty"` Nodes Nodes `json:"nodes"` Controls Controls `json:"controls,omitempty" deepequal:"nil==empty"` MetadataTemplates MetadataTemplates `json:"metadata_templates,omitempty"` MetricTemplates MetricTemplates `json:"metric_templates,omitempty"` TableTemplates TableTemplates `json:"table_templates,omitempty"` }
Topology describes a specific view of a network. It consists of nodes with metadata, and edges. Edges are directional, and embedded in the Node struct.
func (Topology) AddNode ¶
AddNode adds node to the topology under key nodeID; if a node already exists for this key, nmd is merged with that node. This method is different from all the other similar methods in that it mutates the Topology, to solve issues of GC pressure.
func (Topology) GetShape ¶
GetShape returns the current topology shape, or the default if there isn't one.
func (Topology) Merge ¶
Merge merges the other object into this one, and returns the result object. The original is not modified.
func (Topology) ReplaceNode ¶
ReplaceNode adds node to the topology under key nodeID; if a node already exists for this key, node replaces that node. Like AddNode, it mutates the Topology
func (*Topology) UnsafeMerge ¶
UnsafeMerge merges the other object into this one, modifying the original.
func (Topology) WithLabel ¶
WithLabel sets the label terminology of this topology, returning a new topology.
func (Topology) WithMetadataTemplates ¶
func (t Topology) WithMetadataTemplates(other MetadataTemplates) Topology
WithMetadataTemplates merges some metadata templates into this topology, returning a new topology.
func (Topology) WithMetricTemplates ¶
func (t Topology) WithMetricTemplates(other MetricTemplates) Topology
WithMetricTemplates merges some metadata templates into this topology, returning a new topology.
func (Topology) WithShape ¶
WithShape sets the shape of nodes from this topology, returning a new topology.
func (Topology) WithTableTemplates ¶
func (t Topology) WithTableTemplates(other TableTemplates) Topology
WithTableTemplates merges some table templates into this topology, returning a new topology.
type WireMetrics ¶
type WireMetrics struct { Samples []Sample `json:"samples,omitempty"` Min float64 `json:"min"` Max float64 `json:"max"` // contains filtered or unexported fields }
WireMetrics is the on-the-wire representation of Metrics. Only needed for backwards compatibility with probes (time.Time is encoded in binary in MsgPack)
func (*WireMetrics) CodecDecodeSelf ¶
func (*WireMetrics) CodecEncodeSelf ¶
func (WireMetrics) FromIntermediate ¶
func (m WireMetrics) FromIntermediate() Metric
FromIntermediate obtains the metric from a representation suitable for serialization.