metric

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 4 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) NamespacePodContainerName

func (c ContainerMetric) NamespacePodContainerName() metadata.NamespacePodContainerName

NamespacePodContainerName Return identity of the container metric.

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
	StartTime time.Time
	EndTime   time.Time
}

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
	StartTime time.Time
	EndTime   time.Time
}

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) Merge

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

Merge Merge current NodeMetric with input NodeMetric

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

type PodMetric

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

PodMetric Metric model to represent one pod's metric

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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