(limit float64, usedNo float64)
| 30 | ) |
| 31 | |
| 32 | func calculateMemPercent(limit float64, usedNo float64) float64 { |
| 33 | // Limit will never be 0 unless the container is not running and we haven't |
| 34 | // got any data from cgroup |
| 35 | if limit != 0 { |
| 36 | return usedNo / limit * 100.0 |
| 37 | } |
| 38 | return 0 |
| 39 | } |
| 40 | |
| 41 | func SetCgroupStatsFields(previousStats *ContainerStats, data *v1.Metrics, links []netlink.Link, systemInfo SystemInfo) (StatsEntry, error) { |
| 42 | cpuPercent := calculateCgroupCPUPercent(previousStats, data, systemInfo) |
no outgoing calls
no test coverage detected
searching dependent graphs…