Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/vGPUmonitor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ var (
)
ctrDeviceMemorydesc = prometheus.NewDesc(
"hami_container_device_memory_bytes",
`Container device memory usage breakdown in bytes (The label "context_size", "module_size", "buffer_size" and "offset" will be deprecated in v2.10.0, use hami_vgpu_memory_context_bytes, hami_vgpu_memory_module_bytes and hami_vgpu_memory_buffer_bytes instead)`,
[]string{"namespace", "pod", "container", "vdevice_index", "device_uuid", "context_size", "module_size", "buffer_size", "offset"}, nil,
`Container device memory usage in bytes`,
[]string{"namespace", "pod", "container", "vdevice_index", "device_uuid"}, nil,
)
Comment thread
FouoF marked this conversation as resolved.
ctrDeviceUtilizationdesc = prometheus.NewDesc(
"hami_container_device_utilization_ratio",
Expand Down Expand Up @@ -529,12 +529,12 @@ func (cc ClusterManagerCollector) collectContainerMetrics(ch chan<- prometheus.M
}
sendLegacyMetric(ch, legacyCtrvGPUlimitdesc, prometheus.GaugeValue, float64(memoryLimit), labels...)

memoryOffset := memoryTotal - memoryContextSize - memoryModuleSize - memoryBufferSize
memoryLabels := append(labels, fmt.Sprint(memoryContextSize), fmt.Sprint(memoryModuleSize), fmt.Sprint(memoryBufferSize), fmt.Sprint(memoryOffset))
if err := sendMetric(ch, ctrDeviceMemorydesc, prometheus.GaugeValue, float64(memoryTotal), memoryLabels...); err != nil {
if err := sendMetric(ch, ctrDeviceMemorydesc, prometheus.GaugeValue, float64(memoryTotal), labels...); err != nil {
klog.Errorf("Failed to send device memory desc: %v", err)
return err
}
memoryOffset := memoryTotal - memoryContextSize - memoryModuleSize - memoryBufferSize
memoryLabels := append(labels, fmt.Sprint(memoryContextSize), fmt.Sprint(memoryModuleSize), fmt.Sprint(memoryBufferSize), fmt.Sprint(memoryOffset))
sendLegacyMetric(ch, legacyCtrDeviceMemorydesc, prometheus.GaugeValue, float64(memoryTotal), memoryLabels...)

if err := sendMetric(ch, ctrDeviceUtilizationdesc, prometheus.GaugeValue, float64(smUtil), labels...); err != nil {
Expand Down
Loading