Documentation ¶
Index ¶
- type ContainerMetric
- func (c *ContainerMetric) AddSample(metricType metric.ContainerMetricType, sample metric.Sample)
- func (c *ContainerMetric) BuildPodMetric() *PodMetric
- func (c *ContainerMetric) GetSamples(metricType metric.ContainerMetricType) *ContainerMetricSample
- func (c *ContainerMetric) Limit(limit int)
- func (c *ContainerMetric) NamespacePodContainerName() metadata.NamespacePodContainerName
- func (c *ContainerMetric) SortByTimestamp(order DBCommon.Order)
- type ContainerMetricMap
- type ContainerMetricSample
- type ListNodeMetricsRequest
- type ListPodMetricsRequest
- type NodeMetric
- func (n *NodeMetric) AddSample(metricType metric.NodeMetricType, sample metric.Sample)
- func (n *NodeMetric) GetSamples(metricType metric.NodeMetricType) *NodeMetricSample
- func (n *NodeMetric) Limit(limit int)
- func (n *NodeMetric) Merge(in *NodeMetric)
- func (n *NodeMetric) SortByTimestamp(order DBCommon.Order)
- type NodeMetricMap
- type NodeMetricSample
- type NodeMetricsDAO
- type PodMetric
- type PodMetricMap
- type PodMetricsDAO
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[metric.ContainerMetricType][]metric.Sample }
ContainerMetric Metric model to represent one container metric
func NewContainerMetric ¶
func NewContainerMetric() *ContainerMetric
func (*ContainerMetric) AddSample ¶
func (c *ContainerMetric) AddSample(metricType metric.ContainerMetricType, sample metric.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 metric.ContainerMetricType) *ContainerMetricSample
func (*ContainerMetric) Limit ¶
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 ¶
func (c *ContainerMetric) SortByTimestamp(order DBCommon.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) BuildPodsMetricMap ¶
func (c *ContainerMetricMap) BuildPodsMetricMap() PodMetricMap
BuildPodsMetricMap Build PodsMetricMap base on current ContainersMetricMap
func (*ContainerMetricMap) Merge ¶
func (c *ContainerMetricMap) Merge(in ContainerMetricMap)
Merge Merge current ContainersMetricMap with input ContainersMetricMap
type ContainerMetricSample ¶
type ContainerMetricSample struct { Namespace metadata.NamespaceName PodName metadata.PodName ContainerName metadata.ContainerName MetricType metric.ContainerMetricType RateRange int64 Metrics []metric.Sample }
func NewContainerMetricSample ¶
func NewContainerMetricSample() *ContainerMetricSample
type ListNodeMetricsRequest ¶
type ListNodeMetricsRequest struct { DBCommon.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 { DBCommon.QueryCondition Namespace metadata.NamespaceName PodName metadata.PodName RateRange int64 }
ListPodMetricsRequest Argument of method ListPodMetrics
type NodeMetric ¶
type NodeMetric struct { NodeName metadata.NodeName Metrics map[metric.NodeMetricType][]metric.Sample }
NodeMetric Metric model to represent one node metric
func NewNodeMetric ¶
func NewNodeMetric() *NodeMetric
func (*NodeMetric) AddSample ¶
func (n *NodeMetric) AddSample(metricType metric.NodeMetricType, sample metric.Sample)
func (*NodeMetric) GetSamples ¶
func (n *NodeMetric) GetSamples(metricType metric.NodeMetricType) *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 DBCommon.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 metric.NodeMetricType) []*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 DBCommon.Order)
SortByTimestamp Sort each node metric's content
type NodeMetricSample ¶
type NodeMetricSample struct { NodeName metadata.NodeName MetricType metric.NodeMetricType Metrics []metric.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) NamespacePodName ¶
func (p *PodMetric) NamespacePodName() metadata.NamespacePodName
NamespacePodName Return identity of the pod metric
func (*PodMetric) SortByTimestamp ¶
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) Limit ¶
func (p *PodMetricMap) Limit(limit int)
Limit Slicing each pod metric content
func (*PodMetricMap) SortByTimestamp ¶
func (p *PodMetricMap) SortByTimestamp(order DBCommon.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.