Added two parameters

Also ran gofmt
This commit is contained in:
Egon Rijpkema 2018-06-06 10:20:59 +02:00
parent 5972087e93
commit 9e786b3456

View File

@ -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 {