Added rounding to timeing

This commit is contained in:
mjarkk 2019-07-04 21:25:49 +02:00
parent ee53d2447c
commit 74e8d6eb91
No known key found for this signature in database
GPG key ID: 147D0BE9258C6C95

View file

@ -256,7 +256,7 @@ func (c *Container) PlotGraph(spec config.GraphConfig, width int) (string, error
asciigraph.Width(width),
asciigraph.Min(min),
asciigraph.Max(max),
asciigraph.Caption(fmt.Sprintf("%s: %0.2f (%v)", spec.Caption, data[len(data)-1], time.Since(c.StatHistory[0].RecordedAt))),
asciigraph.Caption(fmt.Sprintf("%s: %0.2f (%v)", spec.Caption, data[len(data)-1], time.Since(c.StatHistory[0].RecordedAt).Round(time.Second))),
), nil
}