mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Merge pull request #14069 from brian-athinkingape/cli-fix-memstats-cgroupsv2
cli: for systems with cgroups v2, fix alloation resource utilization showing 0 memory used
This commit is contained in:
3
.changelog/14069.txt
Normal file
3
.changelog/14069.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
cli: Fixed a bug where the memory usage reported by Allocation Resource Utilization is zero on systems using cgroups v2
|
||||
```
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user