Using humanize to convert memory usage to MB

This commit is contained in:
Diptanu Choudhury 2016-06-10 22:24:33 +02:00
parent 2d3798b076
commit d9d5a95160
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ func (c *AllocStatusCommand) taskResources(alloc *api.Allocation, stats map[stri
cpuUsage = fmt.Sprintf("%v/%v", math.Floor(cs.Ticks), resource.CPU)
}
if ms := ru.ResourceUsage.MemoryStats; ms != nil {
memUsage = fmt.Sprintf("%v/%v", ms.RSS/(1024*1024), resource.MemoryMB)
memUsage = fmt.Sprintf("%v/%v", humanize.Bytes(ms.RSS), resource.MemoryMB)
}
}
resourcesOutput = append(resourcesOutput, fmt.Sprintf("%v|%v MB|%v MB|%v|%v",