From 25135c369118558963b13b784acd2b2864a8a91c Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 8 Jun 2016 20:23:54 +0200 Subject: [PATCH] web: round last scrape timestamp to milliseconds --- web/web.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index d321fc041c..9b3f70b2d7 100644 --- a/web/web.go +++ b/web/web.go @@ -377,7 +377,9 @@ func (h *Handler) consolesPath() string { func tmplFuncs(consolesPath string, opts *Options) template_text.FuncMap { return template_text.FuncMap{ - "since": time.Since, + "since": func(t time.Time) time.Duration { + return time.Since(t) / time.Millisecond * time.Millisecond + }, "consolesPath": func() string { return consolesPath }, "pathPrefix": func() string { return opts.ExternalURL.Path }, "stripLabels": func(lset model.LabelSet, labels ...model.LabelName) model.LabelSet {