environment(docker): fix podman compatibility (#151)

This commit is contained in:
Matthew Penner
2022-11-06 13:33:01 -07:00
committed by GitHub
parent f577f5521f
commit 3337362955
10 changed files with 95 additions and 115 deletions

View File

@@ -134,7 +134,11 @@ func calculateDockerAbsoluteCpu(pStats types.CPUStats, stats types.CPUStats) flo
percent := 0.0
if systemDelta > 0.0 && cpuDelta > 0.0 {
percent = (cpuDelta / systemDelta) * cpus * 100.0
percent = (cpuDelta / systemDelta) * 100.0
if cpus > 0 {
percent *= cpus
}
}
return math.Round(percent*1000) / 1000