Not reset-ing the list of pids if they don't change

This commit is contained in:
Diptanu Choudhury
2016-06-11 01:16:52 +02:00
parent 17a0e30068
commit d31034941a
3 changed files with 24 additions and 16 deletions

View File

@@ -362,7 +362,7 @@ func (c *AllocStatusCommand) taskResources(alloc *api.Allocation, stats map[stri
memUsage := strconv.Itoa(resource.MemoryMB)
if ru, ok := stats[task]; ok && ru != nil && ru.ResourceUsage != nil {
if cs := ru.ResourceUsage.CpuStats; cs != nil {
cpuUsage = fmt.Sprintf("%v/%v", math.Floor(cs.Ticks), resource.CPU)
cpuUsage = fmt.Sprintf("%v/%v", math.Floor(cs.TotalTicks), resource.CPU)
}
if ms := ru.ResourceUsage.MemoryStats; ms != nil {
memUsage = fmt.Sprintf("%v/%v", humanize.Bytes(ms.RSS), resource.MemoryMB)