UPSTREAM: google/cadvisor: 1728: Expose total_rss when hierarchy is enabled
@@ -466,8 +466,14 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) {
ret.Memory.Usage = s.MemoryStats.Usage.Usage
ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt
ret.Memory.Cache = s.MemoryStats.Stats["cache"]
+
+ if s.MemoryStats.UseHierarchy {
+ ret.Memory.RSS = s.MemoryStats.Stats["total_rss"]
+ ret.Memory.Swap = s.MemoryStats.Stats["total_swap"]
+ } else {
ret.Memory.RSS = s.MemoryStats.Stats["rss"]
ret.Memory.Swap = s.MemoryStats.Stats["swap"]
+ }
if v, ok := s.MemoryStats.Stats["pgfault"]; ok {
ret.Memory.ContainerData.Pgfault = v
ret.Memory.HierarchicalData.Pgfault = v
