Merge pull request #97 from mjarkk/fix-94

Added rounding to timing (fixes #94)
This commit is contained in:
Jesse Duffield 2019-07-05 10:20:06 +10:00 committed by GitHub
commit cd95ffce49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}