Reduce CPU usage (fixes #1376)
This commit is contained in:
parent
154fc59e93
commit
4b1b56fee8
@ -457,7 +457,7 @@ func restGetSystem(w http.ResponseWriter, r *http.Request) {
|
|||||||
cpusum += p
|
cpusum += p
|
||||||
}
|
}
|
||||||
cpuUsageLock.RUnlock()
|
cpuUsageLock.RUnlock()
|
||||||
res["cpuPercent"] = cpusum / 10
|
res["cpuPercent"] = cpusum / float64(len(cpuUsagePercent)) / float64(runtime.NumCPU())
|
||||||
res["pathSeparator"] = string(filepath.Separator)
|
res["pathSeparator"] = string(filepath.Separator)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user