add percent helper method to metrics

This commit is contained in:
Bradley Cicenas
2017-06-10 13:00:54 +00:00
parent b49e174483
commit 389dee0f3c
5 changed files with 20 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ func (c *Mock) run() {
if c.MemUsage > c.MemLimit {
c.MemUsage = 0
}
c.MemPercent = round((float64(c.MemUsage) / float64(c.MemLimit)) * 100)
c.MemPercent = percent(float64(c.MemUsage), float64(c.MemLimit))
c.stream <- c.Metrics
if c.done {
break