cli: for systems with cgroups v2, fix alloation resource utilization showing 0 memory used

This commit is contained in:
Brian Chau 2022-08-09 14:09:14 -07:00
parent 894e61f4dd
commit 6621bb9db5
1 changed files with 5 additions and 1 deletions

View File

@ -964,7 +964,11 @@ func getActualResources(client *api.Client, runningAllocs []*api.Allocation, nod
}
cpu += stats.ResourceUsage.CpuStats.TotalTicks
mem += stats.ResourceUsage.MemoryStats.RSS
if stats.ResourceUsage.MemoryStats.Usage > 0 {
mem += stats.ResourceUsage.MemoryStats.Usage
} else {
mem += stats.ResourceUsage.MemoryStats.RSS
}
}
resources := make([]string, 2)