Documentation ¶
Index ¶
- Constants
- Variables
- func CollectMetrics() []byte
- func GetMetricValue(col prometheus.Collector) float64
- func Init()
- func MemoryUsage() (virt, rss uint64)
- func MetricsFlags() []cli.Flag
- func NewClientAPI(address string) error
- func StartJobMetricsService(port int) string
- func UpdateBaseMetrics()
- type JobCollector
- type KubernetesMetric
- type MetricInterface
- type Rusage
Constants ¶
View Source
const ( QueryCPUUsageRateQl = "" /* 159-byte string literal not displayed */ QueryMEMUsageRateQl = "" /* 150-byte string literal not displayed */ QueryMEMUsageQl = "sum(container_memory_working_set_bytes{image!=\"\", pod=~\"%s\"}) by (pod)" QueryNetReceiveQl = "sum(rate(container_network_receive_bytes_total{image!=\"\", pod=~\"%s\"}[1m])) by (pod)" QueryNetTransmitQl = "sum(rate(container_network_transmit_bytes_total{image!=\"\", pod=~\"%s\"}[1m])) by (pod)" QueryDiskUsageQl = "sum(container_fs_usage_bytes{image!=\"\", pod=~\"%s\"}) by (pod)" QueryDiskReadQl = "sum(rate(container_fs_reads_bytes_total{image!=\"\", pod=~\"%s\"}[1m])) by (pod)" QueryDiskWriteQl = "sum(rate(container_fs_writes_bytes_total{image!=\"\", pod=~\"%s\"}[1m])) by (pod)" QueryGpuUtilQl = "sum(rate(container_accelerator_duty_cycle{image!=\"\", pod=~\"%s\"}[1m])) by (pod)" QueryGpuMemUtilQl = "" /* 162-byte string literal not displayed */ QueryGpuMemUsageQl = "sum(container_accelerator_memory_used_bytes{image!=\"\", pod=~\"%s\"}) by (pod)" )
Variables ¶
View Source
var PrometheusClientAPI v1.API
Functions ¶
func CollectMetrics ¶
func CollectMetrics() []byte
func GetMetricValue ¶
func GetMetricValue(col prometheus.Collector) float64
func MemoryUsage ¶
func MemoryUsage() (virt, rss uint64)
func MetricsFlags ¶
func MetricsFlags() []cli.Flag
func NewClientAPI ¶
func StartJobMetricsService ¶
func UpdateBaseMetrics ¶
func UpdateBaseMetrics()
Types ¶
type JobCollector ¶
type JobCollector struct { CpuUsageRate *prometheus.GaugeVec MemoryUsage *prometheus.GaugeVec }
func (*JobCollector) Collect ¶
func (j *JobCollector) Collect(ch chan<- prometheus.Metric)
func (*JobCollector) CollectPodMetrics ¶
func (j *JobCollector) CollectPodMetrics(metricName string) error
func (*JobCollector) Describe ¶
func (j *JobCollector) Describe(ch chan<- *prometheus.Desc)
type KubernetesMetric ¶
func (*KubernetesMetric) GetJobAvgMetrics ¶
func (km *KubernetesMetric) GetJobAvgMetrics(metricName, jobID string) (float64, error)
func (*KubernetesMetric) GetJobSequenceMetrics ¶
type MetricInterface ¶
type MetricInterface interface { GetJobAvgMetrics(metricName, jobID string) (float64, error) GetJobSequenceMetrics(metricName, jobID string, start, end, step int64) (model.Value, error) }
func NewKubernetesMetric ¶
func NewKubernetesMetric(clientAPI v1.API) MetricInterface
Click to show internal directories.
Click to hide internal directories.