Added two parameters
Also ran gofmt
This commit is contained in:
parent
5972087e93
commit
9e786b3456
@ -4,21 +4,20 @@ import (
|
||||
"bytes"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
// name, index, temperature.gpu, utilization.gpu,
|
||||
// utilization.memory, memory.total, memory.free, memory.used
|
||||
|
||||
func metrics(response http.ResponseWriter, request *http.Request) {
|
||||
out, err := exec.Command(
|
||||
"nvidia-smi",
|
||||
"--query-gpu=name,index,temperature.gpu,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used",
|
||||
"--query-gpu=name,index,temperature.gpu,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,ecc.errors.uncorrected.aggregate.total,ecc.errors.uncorrected.volatile.total",
|
||||
"--format=csv,noheader,nounits").Output()
|
||||
|
||||
if err != nil {
|
||||
@ -37,7 +36,7 @@ func metrics(response http.ResponseWriter, request *http.Request) {
|
||||
|
||||
metricList := []string{
|
||||
"temperature.gpu", "utilization.gpu",
|
||||
"utilization.memory", "memory.total", "memory.free", "memory.used"}
|
||||
"utilization.memory", "memory.total", "memory.free", "memory.used", "eccerrorsaggregate.total", "eccuncorrectedvolatile.total"}
|
||||
|
||||
result := ""
|
||||
for _, row := range records {
|
||||
|
Loading…
Reference in New Issue
Block a user