mirror of https://github.com/bcicen/ctop.git
Fix query for the number of cpu cores.
This commit is contained in:
parent
be23d85eda
commit
d679478769
|
@ -76,7 +76,10 @@ func (c *Docker) Stop() {
|
|||
}
|
||||
|
||||
func (c *Docker) ReadCPU(stats *api.Stats) {
|
||||
ncpus := uint8(len(stats.CPUStats.CPUUsage.PercpuUsage))
|
||||
ncpus := uint8(stats.CPUStats.OnlineCPUs)
|
||||
if ncpus == 0 {
|
||||
ncpus = uint8(len(stats.CPUStats.CPUUsage.PercpuUsage))
|
||||
}
|
||||
total := float64(stats.CPUStats.CPUUsage.TotalUsage)
|
||||
system := float64(stats.CPUStats.SystemCPUUsage)
|
||||
|
||||
|
|
Loading…
Reference in New Issue