#207 CPU unscaled column changes color according to system total usage

If container uses two cores then CPU column will be always red even if we have dozens of other free cores and CPUS is 1%
This commit is contained in:
Sergey Ponomarev 2020-11-20 23:24:13 +02:00
parent f377dcaee2
commit 9a41252764

View File

@ -24,10 +24,10 @@ func NewCpuScaledCol() CompactCol {
func (w *CPUCol) SetMetrics(m models.Metrics) {
val := m.CPUUtil
w.BarColor = colorScale(val)
if !w.scaleCpu {
val = val * int(m.NCpus)
}
w.BarColor = colorScale(val)
w.Label = fmt.Sprintf("%d%%", val)
if val > 100 {