Documentation ¶
Index ¶
- Constants
- func GetPrometheusClient(address string) (*api.Config, *prometheus.API, error)
- func QueryClusterCpuUsagePercentage(cluster string, client *prometheus.API) (model.Value, error)
- func QueryClusterMemoryUsagePercentage(cluster string, client *prometheus.API) (model.Value, error)
- func QueryClusterNumber(cluster string, client *prometheus.API) (model.Value, error)
- func QueryMasterCpuUsagePercentage(cluster string, client *prometheus.API) (model.Value, error)
- func QueryPodCpuUsage(podPrefix string, client *prometheus.API) (model.Value, error)
- func QueryPodCpuUsagePercentage(podPrefix string, client *prometheus.API) (model.Value, error)
- func QueryPodMemoryUsage(podPrefix string, client *prometheus.API) (model.Value, error)
- func QueryPodMemoryUsagePercentage(podPrefix string, client *prometheus.API) (model.Value, error)
- func QueryWorkerCpuUsagePercentage(cluster string, client *prometheus.API) (model.Value, error)
Constants ¶
View Source
const ( PodCpuUsage = "sum(rate(container_cpu_usage_seconds_total{pod=~\"%s.*\"}[1m])) by (pod)" PodCpuUsagePercentage = "" /* 161-byte string literal not displayed */ PodMemoryUsage = "sum(container_memory_rss{pod=~\"%s.*\"}) by(pod)" // /1024/1024/1024 = GiB PodMemoryUsagePercentage = "" /* 141-byte string literal not displayed */ ClusterCpuUsagePercentage = "" /* 197-byte string literal not displayed */ MasterCpuUsagePercentage = "" /* 179-byte string literal not displayed */ WorkerCpuUsagePercentage = "" /* 181-byte string literal not displayed */ ClusterMemoryUsagePercentage = "" /* 177-byte string literal not displayed */ ClusterNum = "sum(kube_pod_container_info{pod=~\"%s-(masters|replicas)-.\"})" )
Variables ¶
This section is empty.
Functions ¶
func GetPrometheusClient ¶
GetPrometheusClient returns prometheus apiConfig and apiClient
func QueryClusterNumber ¶
func QueryPodCpuUsage ¶
func QueryPodMemoryUsage ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.