types

package
v4.2.505+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 6 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
	RateRange     int64
	Metrics       map[enumconv.MetricType][]types.Sample
}

ContainerMetric Metric model to represent one container metric

func NewContainerMetric

func NewContainerMetric() *ContainerMetric

func (*ContainerMetric) AddSample

func (c *ContainerMetric) AddSample(metricType enumconv.MetricType, sample types.Sample)

func (*ContainerMetric) BuildPodMetric

func (c *ContainerMetric) BuildPodMetric() *PodMetric

BuildPodMetric Build PodMetric consist of the receiver in ContainersMetricMap.

func (*ContainerMetric) GetSamples

func (c *ContainerMetric) GetSamples(metricType enumconv.MetricType) *ContainerMetricSample

func (*ContainerMetric) Limit

func (c *ContainerMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*ContainerMetric) Merge

func (c *ContainerMetric) Merge(in *ContainerMetric)

Merge Merge current ContainersMetricMap with input ContainersMetricMap

func (*ContainerMetric) NamespacePodContainerName

func (c *ContainerMetric) NamespacePodContainerName() metadata.NamespacePodContainerName

NamespacePodContainerName Return identity of the container metric.

func (*ContainerMetric) SortByTimestamp

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

SortByTimestamp Sort each metric samples by timestamp in input order

type ContainerMetricMap

type ContainerMetricMap struct {
	MetricMap map[metadata.NamespacePodContainerName]*ContainerMetric
}

ContainersMetricMap Containers metric map

func NewContainerMetricMap

func NewContainerMetricMap() ContainerMetricMap

func (*ContainerMetricMap) AddContainerMetric

func (c *ContainerMetricMap) AddContainerMetric(containerMetric *ContainerMetric)

func (*ContainerMetricMap) BuildPodsMetricMap

func (c *ContainerMetricMap) BuildPodsMetricMap() PodMetricMap

BuildPodsMetricMap Build PodsMetricMap base on current ContainersMetricMap

type ContainerMetricSample

type ContainerMetricSample struct {
	Namespace     metadata.NamespaceName
	PodName       metadata.PodName
	ContainerName metadata.ContainerName
	MetricType    enumconv.MetricType
	RateRange     int64
	Metrics       []types.Sample
}

func NewContainerMetricSample

func NewContainerMetricSample() *ContainerMetricSample

type ListNodeMetricsRequest

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

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 {
	common.QueryCondition
	Namespace metadata.NamespaceName
	PodName   metadata.PodName
	RateRange int64
}

ListPodMetricsRequest Argument of method ListPodMetrics

type NodeMetric

type NodeMetric struct {
	NodeName metadata.NodeName
	Metrics  map[enumconv.MetricType][]types.Sample
}

NodeMetric Metric model to represent one node metric

func NewNodeMetric

func NewNodeMetric() *NodeMetric

func (*NodeMetric) AddSample

func (n *NodeMetric) AddSample(metricType enumconv.MetricType, sample types.Sample)

func (*NodeMetric) GetSamples

func (n *NodeMetric) GetSamples(metricType enumconv.MetricType) *NodeMetricSample

func (*NodeMetric) Limit

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

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

SortByTimestamp Sort each metric samples by timestamp in input order

type NodeMetricMap

type NodeMetricMap struct {
	MetricMap map[metadata.NodeName]*NodeMetric
}

NodesMetricMap Nodes' metric map

func NewNodeMetricMap

func NewNodeMetricMap() NodeMetricMap

func (*NodeMetricMap) AddNodeMetric

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

AddNodeMetric Add node metric into NodesMetricMap

func (*NodeMetricMap) GetSamples

func (n *NodeMetricMap) GetSamples(metricType enumconv.MetricType) []*NodeMetricSample

func (*NodeMetricMap) Limit

func (n *NodeMetricMap) Limit(limit int)

Limit Limit each node metric's content

func (*NodeMetricMap) SortByTimestamp

func (n *NodeMetricMap) SortByTimestamp(order common.Order)

SortByTimestamp Sort each node metric's content

type NodeMetricSample

type NodeMetricSample struct {
	NodeName   metadata.NodeName
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

func NewNodeMetricSample

func NewNodeMetricSample() *NodeMetricSample

type NodeMetricsDAO

type NodeMetricsDAO interface {
	CreateMetrics(NodeMetricMap) error
	ListMetrics(ListNodeMetricsRequest) (NodeMetricMap, error)
}

NodeMetricsDAO DAO interface of node metric data.

type PodMetric

type PodMetric struct {
	Namespace          metadata.NamespaceName
	PodName            metadata.PodName
	RateRange          int64
	ContainerMetricMap ContainerMetricMap
}

PodMetric Metric model to represent one pod's metric

func NewPodMetric

func NewPodMetric() *PodMetric

func (*PodMetric) Limit

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

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

SortByTimestamp Sort each container metric's content

type PodMetricMap

type PodMetricMap struct {
	MetricMap map[metadata.NamespacePodName]*PodMetric
}

PodsMetricMap Pods' metric map

func NewPodMetricMap

func NewPodMetricMap() PodMetricMap

func (*PodMetricMap) AddContainerMetric

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

AddContainerMetric Add container metric into PodsMetricMap

func (*PodMetricMap) AddPodMetric

func (p *PodMetricMap) AddPodMetric(podMetric *PodMetric)

func (*PodMetricMap) Limit

func (p *PodMetricMap) Limit(limit int)

Limit Slicing each pod metric content

func (*PodMetricMap) SortByTimestamp

func (p *PodMetricMap) SortByTimestamp(order common.Order)

SortByTimestamp Sort each pod metric's content

type PodMetricsDAO

type PodMetricsDAO interface {
	CreateMetrics(PodMetricMap) error
	ListMetrics(ListPodMetricsRequest) (PodMetricMap, error)
}

PodMetricsDAO DAO interface of pod metric data.

Jump to

Keyboard shortcuts

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