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