summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2021-03-05 16:28:53 -0600
committerSean E. Russell <ser@ser1.net>2021-03-05 16:28:53 -0600
commitff2e7e22356625a423218a57f2da4ccebe613541 (patch)
tree83f4d0ef2b35b718b065c05c8d3a091ac36c38d1 /devices
parentefcb0e9d2ab8a8f115b5368da03a75974898ed86 (diff)
Fixes cross-platform building (`func update` shadowing), removes gotop-builder trigger.
Diffstat (limited to 'devices')
-rw-r--r--devices/nvidia.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/devices/nvidia.go b/devices/nvidia.go
index 8f4b21e..f9f421d 100644
--- a/devices/nvidia.go
+++ b/devices/nvidia.go
@@ -96,13 +96,13 @@ func startNVidia(vars map[string]string) error {
}
}
// update once to populate the device names, for the widgets.
- update()
+ updateNvidia()
// Fork off a long-running job to call the nvidia tool periodically,
// parse out the values, and put them in the cache.
go func() {
timer := time.Tick(refresh)
for range timer {
- update()
+ updateNvidia()
}
}()
return nil
@@ -121,7 +121,7 @@ var (
var nvidiaLock sync.Mutex
-// update calls the nvidia tool, parses the output, and caches the results
+// updateNvidia calls the nvidia tool, parses the output, and caches the results
// in the various _* maps. The metric data parsed is: name, index,
// temperature.gpu, utilization.gpu, utilization.memory, memory.total,
// memory.free, memory.used
@@ -130,8 +130,8 @@ var nvidiaLock sync.Mutex
// error and returns immediately. We expect exec errors only when the tool
// isn't available, or when it fails for some reason; no exec error cases
// are recoverable. This does **not** stop the cache job; that will continue
-// to run and continue to call update().
-func update() {
+// to run and continue to call updateNvidia().
+func updateNvidia() {
bs, err := exec.Command(
"nvidia-smi",
"--query-gpu=name,index,temperature.gpu,utilization.gpu,memory.total,memory.used",