Added memory and cpu metrics for cgroupv2
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
This commit is contained in:
@@ -152,6 +152,20 @@ func printCgroup2MetricsTable(w *tabwriter.Writer, data *v2.Metrics) {
|
||||
fmt.Fprintf(w, "pids.current\t%v\t\n", data.Pids.Current)
|
||||
fmt.Fprintf(w, "pids.limit\t%v\t\n", data.Pids.Limit)
|
||||
}
|
||||
if data.CPU != nil {
|
||||
fmt.Fprintf(w, "cpu.usage_usec\t%v\t\n", data.CPU.UsageUsec)
|
||||
fmt.Fprintf(w, "cpu.user_usec\t%v\t\n", data.CPU.UserUsec)
|
||||
fmt.Fprintf(w, "cpu.sys_usec\t%v\t\n", data.CPU.SystemUsec)
|
||||
fmt.Fprintf(w, "cpu.number_of_periods\t%v\t\n", data.CPU.NrPeriods)
|
||||
fmt.Fprintf(w, "cpu.number_of_throttled\t%v\t\n", data.CPU.NrThrottled)
|
||||
fmt.Fprintf(w, "cpu.throttled_usec\t%v\t\n", data.CPU.ThrottledUsec)
|
||||
}
|
||||
if data.Memory != nil {
|
||||
fmt.Fprintf(w, "memory.usage\t%v\t\n", data.Memory.Usage)
|
||||
fmt.Fprintf(w, "memory.usage_limit\t%v\t\n", data.Memory.UsageLimit)
|
||||
fmt.Fprintf(w, "memory.swap\t%v\t\n", data.Memory.SwapUsage)
|
||||
fmt.Fprintf(w, "memory.swap_limit\t%v\t\n", data.Memory.SwapLimit)
|
||||
}
|
||||
}
|
||||
|
||||
func printWindowsContainerStatistics(w *tabwriter.Writer, stats *wstats.WindowsContainerStatistics) {
|
||||
|
Reference in New Issue
Block a user