From ca970952bd59a1eb9e48d1a67d08cb26ee585f39 Mon Sep 17 00:00:00 2001 From: kongfei605 Date: Fri, 8 Mar 2024 10:09:36 +0800 Subject: [PATCH] fix: default values for nvidia_smi query timeout (#822) --- inputs/nvidia_smi/nvidia_smi.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inputs/nvidia_smi/nvidia_smi.go b/inputs/nvidia_smi/nvidia_smi.go index fa1246ec..bab07273 100644 --- a/inputs/nvidia_smi/nvidia_smi.go +++ b/inputs/nvidia_smi/nvidia_smi.go @@ -43,6 +43,9 @@ func (s *GPUStats) Init() error { if s.NvidiaSmiCommand == "" { return types.ErrInstancesEmpty } + if s.QueryTimeOut == 0 { + s.QueryTimeOut = config.Duration(5 * time.Second) + } qFieldsOrdered, qFieldToRFieldMap, err := s.buildQFieldToRFieldMap() if err != nil {