types

package
v4.5.2003+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppMetric

type AppMetric struct {
	ObjectMeta metadata.ObjectMeta
	Metrics    map[enumconv.MetricType][]types.Sample
}

AppMetric Metric model to represent one app metric

func NewAppMetric

func NewAppMetric() *AppMetric

func (*AppMetric) AddSample

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

func (*AppMetric) GetSamples

func (c *AppMetric) GetSamples(metricType enumconv.MetricType) AppMetricSample

func (*AppMetric) Limit

func (c *AppMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*AppMetric) Merge

func (c *AppMetric) Merge(in *AppMetric)

Merge Merge current AppMetricMap with input AppMetricMap

func (*AppMetric) SortByTimestamp

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

SortByTimestamp Sort each metric samples by timestamp in input order

type AppMetricMap

type AppMetricMap struct {
	MetricMap map[metadata.ObjectMeta]*AppMetric
}

AppMetricMap Apps metric map

func NewAppMetricMap

func NewAppMetricMap() AppMetricMap

func (*AppMetricMap) AddAppMetric

func (c *AppMetricMap) AddAppMetric(metric *AppMetric)

func (*AppMetricMap) GetSamples

func (c *AppMetricMap) GetSamples(metricType enumconv.MetricType) []AppMetricSample

func (*AppMetricMap) Limit

func (c *AppMetricMap) Limit(limit int)

Limit Limit each node metric's content

func (*AppMetricMap) SortByTimestamp

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

SortByTimestamp Sort each node metric's content

type AppMetricSample

type AppMetricSample struct {
	ObjectMeta metadata.ObjectMeta
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

type AppMetricsDAO

type AppMetricsDAO interface {
	CreateMetrics(context.Context, AppMetricMap) error
	ListMetrics(context.Context, ListAppMetricsRequest) (AppMetricMap, error)
}

AppMetricsDAO DAO interface of app metric data.

type ClusterMetric

type ClusterMetric struct {
	ObjectMeta metadata.ObjectMeta
	Metrics    map[enumconv.MetricType][]types.Sample
}

ClusterMetric Metric model to represent one namespace metric

func NewClusterMetric

func NewClusterMetric() *ClusterMetric

func (*ClusterMetric) AddSample

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

func (*ClusterMetric) GetSamples

func (c *ClusterMetric) GetSamples(metricType enumconv.MetricType) ClusterMetricSample

func (*ClusterMetric) Limit

func (n *ClusterMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*ClusterMetric) Merge

func (n *ClusterMetric) Merge(in *ClusterMetric)

Merge Merge current ClusterMetric with input ClusterMetric

func (*ClusterMetric) SortByTimestamp

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

SortByTimestamp Sort each metric samples by timestamp in input order

type ClusterMetricMap

type ClusterMetricMap struct {
	MetricMap map[metadata.ObjectMeta]*ClusterMetric
}

ClusterMetricMap Clusters' metric map

func NewClusterMetricMap

func NewClusterMetricMap() ClusterMetricMap

func (*ClusterMetricMap) AddClusterMetric

func (n *ClusterMetricMap) AddClusterMetric(m *ClusterMetric)

AddClusterMetric Add namespace metric into ClustersMetricMap

func (*ClusterMetricMap) GetClusterMetric

func (n *ClusterMetricMap) GetClusterMetric(o metadata.ObjectMeta) ClusterMetric

func (*ClusterMetricMap) GetSamples

func (c *ClusterMetricMap) GetSamples(metricType enumconv.MetricType) []ClusterMetricSample

func (*ClusterMetricMap) Limit

func (n *ClusterMetricMap) Limit(limit int)

Limit Limit each namespace metric's content

func (*ClusterMetricMap) SortByTimestamp

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

SortByTimestamp Sort each namespace metric's content

type ClusterMetricSample

type ClusterMetricSample struct {
	ObjectMeta metadata.ObjectMeta
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

type ClusterMetricsDAO

type ClusterMetricsDAO interface {
	CreateMetrics(context.Context, ClusterMetricMap) error
	ListMetrics(context.Context, ListClusterMetricsRequest) (ClusterMetricMap, error)
}

ClusterMetricsDAO DAO interface of namespace metric data.

type ContainerMeta

type ContainerMeta struct {
	metadata.ObjectMeta
	PodName string
}

type ContainerMetric

type ContainerMetric struct {
	ObjectMeta ContainerMeta
	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) 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[ContainerMeta]*ContainerMetric
}

ContainerMetricMap 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 {
	ObjectMeta ContainerMeta
	MetricType enumconv.MetricType
	RateRange  int64
	Metrics    []types.Sample
}

func NewContainerMetricSample

func NewContainerMetricSample() *ContainerMetricSample

type ControllerMetric

type ControllerMetric struct {
	ObjectMeta ControllerObjectMeta
	Metrics    map[enumconv.MetricType][]types.Sample
}

ControllerMetric Metric model to represent one app metric

func NewControllerMetric

func NewControllerMetric() *ControllerMetric

func (*ControllerMetric) AddSample

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

func (*ControllerMetric) GetSamples

func (c *ControllerMetric) GetSamples(metricType enumconv.MetricType) ControllerMetricSample

func (*ControllerMetric) Limit

func (c *ControllerMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*ControllerMetric) Merge

func (c *ControllerMetric) Merge(in *ControllerMetric)

Merge Merge current ControllerMetricMap with input ControllerMetricMap

func (*ControllerMetric) SortByTimestamp

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

SortByTimestamp Sort each metric samples by timestamp in input order

type ControllerMetricMap

type ControllerMetricMap struct {
	MetricMap map[ControllerObjectMeta]*ControllerMetric
}

ControllerMetricMap Controllers metric map

func NewControllerMetricMap

func NewControllerMetricMap() ControllerMetricMap

func (*ControllerMetricMap) AddControllerMetric

func (c *ControllerMetricMap) AddControllerMetric(metric *ControllerMetric)

func (*ControllerMetricMap) GetSamples

func (c *ControllerMetricMap) GetSamples(metricType enumconv.MetricType) []ControllerMetricSample

func (*ControllerMetricMap) Limit

func (c *ControllerMetricMap) Limit(limit int)

Limit Limit each node metric's content

func (*ControllerMetricMap) SortByTimestamp

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

SortByTimestamp Sort each node metric's content

type ControllerMetricSample

type ControllerMetricSample struct {
	ObjectMeta ControllerObjectMeta
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

type ControllerMetricsDAO

type ControllerMetricsDAO interface {
	CreateMetrics(context.Context, ControllerMetricMap) error
	ListMetrics(context.Context, ListControllerMetricsRequest) (ControllerMetricMap, error)
}

ControllerMetricsDAO DAO interface of app metric data.

type ControllerObjectMeta

type ControllerObjectMeta struct {
	metadata.ObjectMeta
	Kind string
}

type ListAppMetricsRequest

type ListAppMetricsRequest struct {
	common.QueryCondition
	ObjectMetas []metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
}

ListAppMetricsRequest Argument of method ListMetrics AppObjectMetas is used to assign to list specific apps metrics

type ListClusterMetricsRequest

type ListClusterMetricsRequest struct {
	common.QueryCondition
	ObjectMetas []metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
}

ListClusterMetricsRequest Argument of method ListClusterMetrics

type ListControllerMetricsRequest

type ListControllerMetricsRequest struct {
	common.QueryCondition
	ObjectMetas []metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
	Kind        string // DEPLOYMENT, DEPLOYMENTCONFIG and STATEFULSET
}

ListControllerMetricsRequest Argument of method ListMetrics ControllerObjectMetas is used to assign to list specific apps metrics

type ListNamespaceMetricsRequest

type ListNamespaceMetricsRequest struct {
	common.QueryCondition
	ObjectMetas []metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
}

ListNamespaceMetricsRequest Argument of method ListNamespaceMetrics

type ListNodeMetricsRequest

type ListNodeMetricsRequest struct {
	common.QueryCondition
	ObjectMetas []metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
}

ListNodeMetricsRequest Argument of method ListNodeMetrics

func NewListNodeMetricsRequest

func NewListNodeMetricsRequest() ListNodeMetricsRequest

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
	ObjectMetas []*metadata.ObjectMeta
	MetricTypes []enumconv.MetricType
	RateRange   int64
}

ListPodMetricsRequest Argument of method ListPodMetrics

func NewListPodMetricsRequest

func NewListPodMetricsRequest() ListPodMetricsRequest

type NamespaceMetric

type NamespaceMetric struct {
	ObjectMeta metadata.ObjectMeta
	Metrics    map[enumconv.MetricType][]types.Sample
}

NamespaceMetric Metric model to represent one namespace metric

func NewNamespaceMetric

func NewNamespaceMetric() *NamespaceMetric

func (*NamespaceMetric) AddSample

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

func (*NamespaceMetric) GetSamples

func (c *NamespaceMetric) GetSamples(metricType enumconv.MetricType) NamespaceMetricSample

func (*NamespaceMetric) Limit

func (n *NamespaceMetric) Limit(limit int)

Limit Slicing each metric samples element

func (*NamespaceMetric) Merge

func (n *NamespaceMetric) Merge(in *NamespaceMetric)

Merge Merge current NamespaceMetric with input NamespaceMetric

func (*NamespaceMetric) SortByTimestamp

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

SortByTimestamp Sort each metric samples by timestamp in input order

type NamespaceMetricMap

type NamespaceMetricMap struct {
	MetricMap map[metadata.ObjectMeta]*NamespaceMetric
}

NamespaceMetricMap Namespaces' metric map

func NewNamespaceMetricMap

func NewNamespaceMetricMap() NamespaceMetricMap

func (*NamespaceMetricMap) AddNamespaceMetric

func (n *NamespaceMetricMap) AddNamespaceMetric(m *NamespaceMetric)

AddNamespaceMetric Add namespace metric into NamespacesMetricMap

func (*NamespaceMetricMap) GetSamples

func (c *NamespaceMetricMap) GetSamples(metricType enumconv.MetricType) []NamespaceMetricSample

func (*NamespaceMetricMap) Limit

func (n *NamespaceMetricMap) Limit(limit int)

Limit Limit each namespace metric's content

func (*NamespaceMetricMap) SortByTimestamp

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

SortByTimestamp Sort each namespace metric's content

type NamespaceMetricSample

type NamespaceMetricSample struct {
	ObjectMeta metadata.ObjectMeta
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

type NamespaceMetricsDAO

type NamespaceMetricsDAO interface {
	CreateMetrics(context.Context, NamespaceMetricMap) error
	ListMetrics(context.Context, ListNamespaceMetricsRequest) (NamespaceMetricMap, error)
}

NamespaceMetricsDAO DAO interface of namespace metric data.

type NodeMetric

type NodeMetric struct {
	ObjectMeta metadata.ObjectMeta
	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.ObjectMeta]*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 {
	ObjectMeta metadata.ObjectMeta
	MetricType enumconv.MetricType
	Metrics    []types.Sample
}

func NewNodeMetricSample

func NewNodeMetricSample() *NodeMetricSample

type NodeMetricsDAO

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

NodeMetricsDAO DAO interface of node metric data.

type PodMetric

type PodMetric struct {
	ObjectMeta         metadata.ObjectMeta
	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.ObjectMeta]*PodMetric
}

PodMetricMap 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(context.Context, PodMetricMap) error
	ListMetrics(context.Context, 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