Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cmd/scheduler/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (cc ClusterManagerCollector) collectNodeMetrics(ch chan<- prometheus.Metric
nodeGPUMemoryPercentage := prometheus.NewDesc(
"hami_node_gpu_memory_allocated_ratio",
"GPU Memory Allocated Percentage on a certain GPU",
[]string{"node", "device_uuid", "device_index"}, nil,
[]string{"node", "device_uuid", "device_index", "device_type"}, nil,
)
nodeGPUMigInstance := prometheus.NewDesc(
"hami_node_gpu_mig_instance_info",
Expand Down Expand Up @@ -261,7 +261,7 @@ func (cc ClusterManagerCollector) collectNodeMetrics(ch chan<- prometheus.Metric
}

if devs.Device.Totalmem > 0 {
if err := sendMetric(ch, nodeGPUMemoryPercentage, prometheus.GaugeValue, float64(devs.Device.Usedmem)/float64(devs.Device.Totalmem), nodeID, devs.Device.ID, fmt.Sprint(devs.Device.Index)); err != nil {
if err := sendMetric(ch, nodeGPUMemoryPercentage, prometheus.GaugeValue, float64(devs.Device.Usedmem)/float64(devs.Device.Totalmem), nodeID, devs.Device.ID, fmt.Sprint(devs.Device.Index), devs.Device.Type); err != nil {
klog.V(4).Infof("Failed to send nodeGPUMemoryPercentage metric: %v", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/scheduler/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ hami_gpu_core_limit_ratio{device_index="1",device_type="test-device",device_uuid
hami_gpu_core_limit_ratio{device_index="2",device_type="NVIDIA",device_uuid="normal-memory",node="node-1"} 2
# HELP hami_node_gpu_memory_allocated_ratio GPU Memory Allocated Percentage on a certain GPU
# TYPE hami_node_gpu_memory_allocated_ratio gauge
hami_node_gpu_memory_allocated_ratio{device_index="2",device_uuid="normal-memory",node="node-1"} 0.25
hami_node_gpu_memory_allocated_ratio{device_index="2",device_type="NVIDIA",device_uuid="normal-memory",node="node-1"} 0.25
# HELP nodeGPUMemoryPercentage GPU Memory Allocated Percentage on a certain GPU
# TYPE nodeGPUMemoryPercentage gauge
nodeGPUMemoryPercentage{deviceidx="2",deviceuuid="normal-memory",nodeid="node-1"} 0.25
Expand Down
Loading