gpu: fix windows_gpu_info metric (#2130)

This commit is contained in:
Jan-Otto Kröpke
2025-07-13 01:05:59 +02:00
committed by GitHub
parent 6b8c895a68
commit 524fea08c4
12 changed files with 534 additions and 255 deletions

View File

@@ -18,12 +18,13 @@
package gpu
import (
"fmt"
"strings"
)
type Instance struct {
Pid string
Luid [2]string
Luid string
Phys string
Eng string
Engtype string
@@ -32,11 +33,13 @@ type Instance struct {
type PidPhys struct {
Pid string
Luid string
Phys string
}
type PidPhysEngEngType struct {
Pid string
Luid string
Phys string
Eng string
Engtype string
@@ -58,8 +61,7 @@ func parseGPUCounterInstanceString(s string) Instance {
}
case "luid":
if i+2 < len(parts) {
instance.Luid[0] = parts[i+1]
instance.Luid[1] = parts[i+2]
instance.Luid = fmt.Sprintf("%s_%s", parts[i+1], parts[i+2])
}
case "phys":
if i+1 < len(parts) {