metric

package
v0.3.56 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerMetric

type ContainerMetric struct {
	Namespace     metadata.NamespaceName
	PodName       metadata.PodName
	ContainerName metadata.ContainerName
	Metrics       map[metric.ContainerMetricType][]metric.Sample
}

ContainerMetric Metric model to represent one container metric

func (*ContainerMetric) BuildPodMetric

func (c *ContainerMetric) BuildPodMetric() *PodMetric

BuildPodMetric Build PodMetric consist of the receiver in ContainersMetricMap.

func (*ContainerMetric) Limit added in v0.3.0

func (c *ContainerMetric) Limit(limit int)

Limit Slicing each metric samples element

func (ContainerMetric) NamespacePodContainerName

func (c ContainerMetric) NamespacePodContainerName() metadata.NamespacePodContainerName

NamespacePodContainerName Return identity of the container metric.

func (*ContainerMetric) SortByTimestamp added in v0.3.0

func (c *ContainerMetric) SortByTimestamp(order DBCommon.Order)

SortByTimestamp Sort each metric samples by timestamp in input order

type ContainersMetricMap

type ContainersMetricMap map[metadata.NamespacePodContainerName]*ContainerMetric

ContainersMetricMap Containers metric map

func (ContainersMetricMap) BuildPodsMetricMap

func (c ContainersMetricMap) BuildPodsMetricMap() *PodsMetricMap

BuildPodsMetricMap Build PodsMetricMap base on current ContainersMetricMap

func (*ContainersMetricMap) Merge

Merge Merge current ContainersMetricMap with input ContainersMetricMap

type ListNodeMetricsRequest

type ListNodeMetricsRequest struct {
	NodeNames []metadata.NodeName
	DBCommon.QueryCondition
}

ListNodeMetricsRequest Argument of method ListNodeMetrics

func (ListNodeMetricsRequest) GetEmptyNodeNames

func (r ListNodeMetricsRequest) GetEmptyNodeNames() []metadata.NodeName

GetEmptyNodeNames Return slice with one empty string element

func (ListNodeMetricsRequest) GetNodeNames

func (r ListNodeMetricsRequest) GetNodeNames() []metadata.NodeName

GetNodeNames Return nodes name in request

type ListPodMetricsRequest

type ListPodMetricsRequest struct {
	Namespace metadata.NamespaceName
	PodName   metadata.PodName
	DBCommon.QueryCondition
}

ListPodMetricsRequest Argument of method ListPodMetrics

type MetricsDAO

type MetricsDAO interface {
	ListPodMetrics(ListPodMetricsRequest) (PodsMetricMap, error)
	ListNodesMetric(ListNodeMetricsRequest) (NodesMetricMap, error)
}

MetricsDAO DAO interface of metric data.

type NodeMetric

type NodeMetric struct {
	NodeName metadata.NodeName
	Metrics  map[metric.NodeMetricType][]metric.Sample
}

NodeMetric Metric model to represent one node metric

func (*NodeMetric) Limit added in v0.3.0

func (n *NodeMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*NodeMetric) Merge

func (n *NodeMetric) Merge(in *NodeMetric)

Merge Merge current NodeMetric with input NodeMetric

func (*NodeMetric) SortByTimestamp added in v0.3.0

func (n *NodeMetric) SortByTimestamp(order DBCommon.Order)

SortByTimestamp Sort each metric samples by timestamp in input order

type NodesMetricMap

type NodesMetricMap map[metadata.NodeName]*NodeMetric

NodesMetricMap Nodes' metric map

func (*NodesMetricMap) AddNodeMetric

func (n *NodesMetricMap) AddNodeMetric(nodeMetric *NodeMetric)

AddNodeMetric Add node metric into NodesMetricMap

func (*NodesMetricMap) Limit added in v0.3.0

func (n *NodesMetricMap) Limit(limit int)

Limit Limit each node metric's content

func (*NodesMetricMap) SortByTimestamp added in v0.3.0

func (n *NodesMetricMap) SortByTimestamp(order DBCommon.Order)

SortByTimestamp Sort each node metric's content

type PodMetric

type PodMetric struct {
	Namespace           metadata.NamespaceName
	PodName             metadata.PodName
	ContainersMetricMap *ContainersMetricMap
}

PodMetric Metric model to represent one pod's metric

func (*PodMetric) Limit added in v0.3.0

func (p *PodMetric) Limit(limit int)

Limit Slicing each container metric content

func (*PodMetric) Merge

func (p *PodMetric) Merge(in *PodMetric)

Merge Merge current PodMetric with input PodMetric

func (PodMetric) NamespacePodName

func (p PodMetric) NamespacePodName() metadata.NamespacePodName

NamespacePodName Return identity of the pod metric

func (*PodMetric) SortByTimestamp added in v0.3.0

func (p *PodMetric) SortByTimestamp(order DBCommon.Order)

SortByTimestamp Sort each container metric's content

type PodsMetricMap

type PodsMetricMap map[metadata.NamespacePodName]*PodMetric

PodsMetricMap Pods' metric map

func (*PodsMetricMap) AddContainerMetric

func (p *PodsMetricMap) AddContainerMetric(c *ContainerMetric)

AddContainerMetric Add container metric into PodsMetricMap

func (*PodsMetricMap) Limit added in v0.3.0

func (p *PodsMetricMap) Limit(limit int)

Limit Slicing each pod metric content

func (*PodsMetricMap) SortByTimestamp added in v0.3.0

func (p *PodsMetricMap) SortByTimestamp(order DBCommon.Order)

SortByTimestamp Sort each pod metric's content

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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