Skip to content
Open
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
1 change: 1 addition & 0 deletions inputs/nvidia_smi/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

const (
uuidQField qField = "uuid"
indexQField qField = "index"
nameQField qField = "name"
driverModelCurrentQField qField = "driver_model.current"
driverModelPendingQField qField = "driver_model.pending"
Expand Down
4 changes: 3 additions & 1 deletion inputs/nvidia_smi/nvidia_smi.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (s *GPUStats) Gather(slist *types.SampleList) {

for _, currentRow := range currentTable.rows {
uuid := strings.TrimPrefix(strings.ToLower(currentRow.qFieldToCells[uuidQField].rawValue), "gpu-")
index := currentRow.qFieldToCells[indexQField].rawValue
name := currentRow.qFieldToCells[nameQField].rawValue
driverModelCurrent := currentRow.qFieldToCells[driverModelCurrentQField].rawValue
driverModelPending := currentRow.qFieldToCells[driverModelPendingQField].rawValue
Expand All @@ -88,6 +89,7 @@ func (s *GPUStats) Gather(slist *types.SampleList) {

slist.PushFront(types.NewSample(inputName, "gpu_info", 1, map[string]string{
"uuid": uuid,
"index": index,
"name": name,
"driver_model_current": driverModelCurrent,
"driver_model_pending": driverModelPending,
Expand All @@ -106,7 +108,7 @@ func (s *GPUStats) Gather(slist *types.SampleList) {
continue
}

slist.PushFront(types.NewSample(inputName, metricInfo.metricName, num, map[string]string{"uuid": uuid}))
slist.PushFront(types.NewSample(inputName, metricInfo.metricName, num, map[string]string{"uuid": uuid, "index": index}))
Comment on lines 109 to +111
}
}
}
1 change: 1 addition & 0 deletions inputs/nvidia_smi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (

requiredFields = []qField{
uuidQField,
indexQField,
nameQField,
Comment on lines 25 to 28
driverModelCurrentQField,
driverModelPendingQField,
Expand Down
Loading