Add cfs throttle stats to cgroup v2

Signed-off-by: Odin Ugedal <odin@uged.al>
This commit is contained in:
Odin Ugedal
2021-04-16 11:30:12 +02:00
parent fce58ab2d5
commit ee3b563de7
+9
View File
@@ -70,6 +70,15 @@ func statCpu(dirPath string, stats *cgroups.Stats) error {
case "system_usec":
stats.CpuStats.CpuUsage.UsageInKernelmode = v * 1000
case "nr_periods":
stats.CpuStats.ThrottlingData.Periods = v
case "nr_throttled":
stats.CpuStats.ThrottlingData.ThrottledPeriods = v
case "throttled_usec":
stats.CpuStats.ThrottlingData.ThrottledTime = v * 1000
}
}
return nil