Merge pull request #1718 from prometheus/fabxc-template-round

web: round last scrape timestamp to milliseconds
pull/1721/head
Fabian Reinartz 2016-06-08 20:30:01 +02:00
commit a08943e6d3
1 changed files with 3 additions and 1 deletions

View File

@ -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 {