mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
Display dates as well as timestamps in status page (#7544)
* Display dates as well as timestamps in the status page Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> * Trim trailing whitespaces Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This commit is contained in:
parent
be96951c56
commit
6a00626ee9
|
@ -99,14 +99,14 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Number Of Series </th>
|
<th>Number Of Series </th>
|
||||||
<th>Number of Chunks</th>
|
<th>Number of Chunks</th>
|
||||||
<th>Current Max Time</th>
|
|
||||||
<th>Current Min Time</th>
|
<th>Current Min Time</th>
|
||||||
|
<th>Current Max Time</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td scope="row">{{ .NumSeries}}</td>
|
<td scope="row">{{ .NumSeries}}</td>
|
||||||
<td>{{.ChunkCount}}</td>
|
<td>{{.ChunkCount}}</td>
|
||||||
<td>{{ .MaxTime}}</td>
|
<td>{{ .MinTime | unixToTime }} ({{ .MinTime }})</td>
|
||||||
<td>{{ .MinTime}}</td>
|
<td>{{ .MaxTime | unixToTime }} ({{ .MaxTime }})</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -982,6 +982,10 @@ func tmplFuncs(consolesPath string, opts *Options) template_text.FuncMap {
|
||||||
"since": func(t time.Time) time.Duration {
|
"since": func(t time.Time) time.Duration {
|
||||||
return time.Since(t) / time.Millisecond * time.Millisecond
|
return time.Since(t) / time.Millisecond * time.Millisecond
|
||||||
},
|
},
|
||||||
|
"unixToTime": func(i int64) time.Time {
|
||||||
|
t := time.Unix(i/int64(time.Microsecond), 0).UTC()
|
||||||
|
return t
|
||||||
|
},
|
||||||
"consolesPath": func() string { return consolesPath },
|
"consolesPath": func() string { return consolesPath },
|
||||||
"pathPrefix": func() string { return opts.ExternalURL.Path },
|
"pathPrefix": func() string { return opts.ExternalURL.Path },
|
||||||
"pageTitle": func() string { return opts.PageTitle },
|
"pageTitle": func() string { return opts.PageTitle },
|
||||||
|
|
Loading…
Reference in a new issue