mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
Fix cpu count estimation (#281)
* Fix query for the number of cpu cores. * Fix formating * Fix formating again...
This commit is contained in:
parent
be23d85eda
commit
350cb09338
@ -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
Block a user