We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b01d4a commit 80d1be4Copy full SHA for 80d1be4
1 file changed
reporter/utils/utils.go
@@ -160,6 +160,12 @@ func getDisk(interval int) (uint64, uint64) {
160
161
func getCpu(interval int) float64 {
162
cpuInfo, _ := cpu.Percent(time.Duration(interval)*time.Second, false)
163
+ if len(cpuInfo) == 0 {
164
+ // If no CPU info available, return 0.0 as fallback
165
+ log.Println("Warning: Unable to get CPU usage information, returning 0.0")
166
+ return 0.0
167
+ }
168
+
169
return math.Round(cpuInfo[0]*10) / 10
170
}
171
0 commit comments