Documentation ¶
Index ¶
- func ExportCSV(prefix string, rows [][]string) string
- func FormatContainerMetrics(containerMetrics []*ContainerMetrics, metric_type v1.ResourceName, ...) (rows [][]string, total int64)
- func FormatResourceUsage(capacity v1.ResourceList, resources []*ContainerResources, field string, ...) (rows [][]string)
- func GetField(r interface{}, field string) interface{}
- func GetFields(r interface{}) []string
- func MinMax_float64(array []float64) (float64, float64)
- func MinMax_int64(array []int64) (int64, int64)
- func NodeCapacity(node *api_v1.Node) api_v1.ResourceList
- func PrintContainerMetrics(rows [][]string, duration time.Duration, total int64)
- func PrintResourceUsage(rows [][]string)
- type ContainerMetrics
- type ContainerResources
- type CpuResource
- type KubeClient
- func (k *KubeClient) ActivePods(namespace, nodeName string) ([]api_v1.Pod, error)
- func (k *KubeClient) ClusterCapacity() (capacity api_v1.ResourceList, err error)
- func (k *KubeClient) ContainerResources(namespace string) (resources []*ContainerResources, err error)
- func (k *KubeClient) Historical(project, namespace string, workers int, resourceName v1.ResourceName, ...)
- func (k *KubeClient) NodeResources(namespace, nodeName string) (resources []*ContainerResources, err error)
- func (k *KubeClient) ResourceUsage(namespace, sort string, reverse bool, csv bool)
- type MemoryResource
- type MetricJob
- type StackDriverClient
- func (s *StackDriverClient) ContainerMetrics(container_name string, pod_uid string, duration time.Duration, ...) *ContainerMetrics
- func (s *StackDriverClient) ListTimeSeries(filter_map map[string]string, duration time.Duration) *monitoring.TimeSeriesIterator
- func (s *StackDriverClient) Run(jobs chan<- *MetricJob, collector <-chan *ContainerMetrics, pods []v1.Pod, ...) (metrics []*ContainerMetrics)
- func (s *StackDriverClient) Worker(jobs <-chan *MetricJob, collector chan<- *ContainerMetrics)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatContainerMetrics ¶
func FormatContainerMetrics(containerMetrics []*ContainerMetrics, metric_type v1.ResourceName, duration time.Duration, field string, reverse bool) (rows [][]string, total int64)
func FormatResourceUsage ¶
func FormatResourceUsage(capacity v1.ResourceList, resources []*ContainerResources, field string, reverse bool) (rows [][]string)
func MinMax_float64 ¶
func MinMax_int64 ¶
func NodeCapacity ¶
func NodeCapacity(node *api_v1.Node) api_v1.ResourceList
func PrintContainerMetrics ¶
func PrintResourceUsage ¶
func PrintResourceUsage(rows [][]string)
Types ¶
type ContainerMetrics ¶
type ContainerMetrics struct { ContainerName string PodName string NodeName string MetricType v1.ResourceName MemoryMin *MemoryResource MemoryMax *MemoryResource MemoryMode *MemoryResource MemoryLast *MemoryResource CpuMin *CpuResource CpuMax *CpuResource CpuAvg *CpuResource CpuLast *CpuResource DataPoints int64 }
func (ContainerMetrics) Validate ¶
func (m ContainerMetrics) Validate(field string) bool
type ContainerResources ¶
type ContainerResources struct { Name string Namespace string CpuReq *CpuResource CpuLimit *CpuResource PercentCpuReq int64 PercentCpuLimit int64 MemReq *MemoryResource MemLimit *MemoryResource PercentMemoryReq int64 PercentMemoryLimit int64 }
func (ContainerResources) Validate ¶
func (r ContainerResources) Validate(field string) bool
type CpuResource ¶
func NewCpuResource ¶
func NewCpuResource(value int64) *CpuResource
func (*CpuResource) String ¶
func (r *CpuResource) String() string
func (*CpuResource) ToQuantity ¶
func (r *CpuResource) ToQuantity() *resource.Quantity
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
func NewKubeClient ¶
func NewKubeClient( clientset *kubernetes.Clientset, ) *KubeClient
func (*KubeClient) ActivePods ¶
func (k *KubeClient) ActivePods(namespace, nodeName string) ([]api_v1.Pod, error)
func (*KubeClient) ClusterCapacity ¶
func (k *KubeClient) ClusterCapacity() (capacity api_v1.ResourceList, err error)
func (*KubeClient) ContainerResources ¶
func (k *KubeClient) ContainerResources(namespace string) (resources []*ContainerResources, err error)
func (*KubeClient) Historical ¶
func (k *KubeClient) Historical(project, namespace string, workers int, resourceName v1.ResourceName, duration time.Duration, sort string, reverse bool, csv bool)
func (*KubeClient) NodeResources ¶
func (k *KubeClient) NodeResources(namespace, nodeName string) (resources []*ContainerResources, err error)
func (*KubeClient) ResourceUsage ¶
func (k *KubeClient) ResourceUsage(namespace, sort string, reverse bool, csv bool)
type MemoryResource ¶
func NewMemoryResource ¶
func NewMemoryResource(value int64) *MemoryResource
func (*MemoryResource) String ¶
func (r *MemoryResource) String() string
func (*MemoryResource) ToQuantity ¶
func (r *MemoryResource) ToQuantity() *resource.Quantity
type StackDriverClient ¶
type StackDriverClient struct {
// contains filtered or unexported fields
}
func NewStackDriverClient ¶
func NewStackDriverClient(project string) *StackDriverClient
func (*StackDriverClient) ContainerMetrics ¶
func (s *StackDriverClient) ContainerMetrics(container_name string, pod_uid string, duration time.Duration, metric_type v1.ResourceName) *ContainerMetrics
func (*StackDriverClient) ListTimeSeries ¶
func (s *StackDriverClient) ListTimeSeries(filter_map map[string]string, duration time.Duration) *monitoring.TimeSeriesIterator
func (*StackDriverClient) Run ¶
func (s *StackDriverClient) Run(jobs chan<- *MetricJob, collector <-chan *ContainerMetrics, pods []v1.Pod, duration time.Duration, metric_type v1.ResourceName) (metrics []*ContainerMetrics)
func (*StackDriverClient) Worker ¶
func (s *StackDriverClient) Worker(jobs <-chan *MetricJob, collector chan<- *ContainerMetrics)
Click to show internal directories.
Click to hide internal directories.