Documentation ¶
Index ¶
Constants ¶
View Source
const ( KubernetesPodNameLabel = "io.kubernetes.pod.name" KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" KubernetesPodUIDLabel = "io.kubernetes.pod.uid" KubernetesContainerNameLabel = "io.kubernetes.container.name" PodInfraContainerName = "POD" )
Variables ¶
This section is empty.
Functions ¶
func GetContainerName ¶
GetContainerName get pod container name from docker container labels
func GetPodName ¶
GetPodName get pod name from docker container labels
func GetPodNamespace ¶
GetPodNamespace get pod namespace from docker container labels
Types ¶
type CgroupRef ¶
type CgroupRef struct { Name string ContainerName string PodName string PodNamespace string PodUid string AppClass appclass.AppClass }
CgroupRef group pod infos
type CgroupStats ¶
type CgroupStats struct { Ref *CgroupRef `structs:"ref,omitempty"` CpuUsage float64 `structs:"cpu_usage"` NrCpuThrottled float64 `structs:"nr_cpu_throttled"` LoadAvg float64 `structs:"load_avg"` MemoryTotalUsage float64 `structs:"memory_total_usage"` MemoryWorkingSetUsage float64 `structs:"memory_working_set_usage"` MemoryCacheUsage float64 `structs:"memory_cache_usage"` TcpOOM float64 `structs:"tcp_oom"` ListenOverflows float64 `structs:"listen_overflows"` RxBps float64 `structs:"rx_bps"` RxPps float64 `structs:"rx_pps"` TxBps float64 `structs:"tx_bps"` TxPps float64 `structs:"tx_pps"` Timestamp time.Time `structs:"timestamp,omitempty"` }
CgroupStats group cgroup state options
func (*CgroupStats) GetTags ¶
func (cg *CgroupStats) GetTags() []string
GetTags get all tags for the struct
type CgroupStore ¶
type CgroupStore interface { Run(stop <-chan struct{}) CgroupStoreInterface }
CgroupStore describe cgroup resource state interface inherit from state store
func NewCgroupStoreManager ¶
func NewCgroupStoreManager(config types.MetricsContainerConfig, podInformer cache.SharedIndexInformer) CgroupStore
NewCgroupStoreManager create a ContainerStats instance to collect container metrics
type CgroupStoreInterface ¶
type CgroupStoreInterface interface { MachineInfo() (*cadvisorapi.MachineInfo, error) GetCgroupResourceRangeStats(podName, podNamespace string, start, end time.Time, count int) ([]*CgroupStats, error) GetCgroupResourceRecentState(podName, podNamespace string, updateStats bool) (*CgroupStats, error) GetCgroupResourceRecentStateByPath(cgPath string, updateStats bool) (*CgroupStats, error) ListCgroupResourceRangeStats(start, end time.Time, count int, classFilter sets.String) ( map[string][]*CgroupStats, error) ListCgroupResourceRecentState(updateStats bool, classFilter sets.String) (map[string]*CgroupStats, error) ListAllCgroups(classFilter sets.String) (map[string]*CgroupRef, error) // AddExtraCgroups will restart cadvisor manager with high cost, so should try not call the function AddExtraCgroups(extraCgs []string) error GetCgroupStoreSupportedTags() []string }
CgroupStoreInterface describe cgroup resource state interface
Click to show internal directories.
Click to hide internal directories.