carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1{{define "metrics"}}{{template "top" .}}
2<h1>Fleet metrics</h1>
3
4{{if .MetricAlerts}}
5<h2 class="error">Alerts</h2>
6<div class="tablewrap">
7<table>
8 <tr><th>Box</th><th>Rule</th><th>Value</th><th>Fired</th></tr>
9 {{range .MetricAlerts}}
10 <tr>
11 <td>{{.Box}}</td>
12 <td>{{.Rule}}</td>
13 <td class="error">{{alertVal .Rule .Value}}</td>
14 <td>{{fmtTime .FiredAt}}</td>
15 </tr>
16 {{end}}
17</table>
18</div>
19{{end}}
20
21{{if .Metrics}}
22{{range .Metrics}}
23<h2>{{.Box}}</h2>
24<p class="small">Latest {{fmtTime .At}}</p>
25<section class="tiles" aria-label="{{.Box}} headline metrics">
26 <div class="tile">
27 <h2>CPU</h2>
28 <p class="tile-value">{{pct .CPU}}</p>
29 <svg viewBox="0 0 240 40"><polyline fill="none" stroke="currentColor" points="{{.SparkCPU}}"/></svg>
30 </div>
31 <div class="tile">
32 <h2>Memory</h2>
33 <p class="tile-value">{{pct .Mem}}</p>
34 <svg viewBox="0 0 240 40"><polyline fill="none" stroke="currentColor" points="{{.SparkMem}}"/></svg>
35 </div>
36 <div class="tile">
37 <h2>Disk</h2>
38 <p class="tile-value">{{pct .Disk}}</p>
39 <svg viewBox="0 0 240 40"><polyline fill="none" stroke="currentColor" points="{{.SparkDisk}}"/></svg>
40 </div>
41</section>
42
43{{if .Units}}
44<div class="tablewrap">
45<table>
46 <tr><th>Unit</th><th>CPU</th><th>Memory</th><th>IO</th></tr>
47 {{range .Units}}
48 <tr>
49 <td>{{.Unit}}</td>
50 <td>{{pct .CPUFrac}}</td>
51 <td>{{bytesOrDash .MemBytes}}</td>
52 <td>R {{bytesOrDash .ReadBytes}} &middot; W {{bytesOrDash .WriteBytes}}</td>
53 </tr>
54 {{end}}
55</table>
56</div>
57{{else}}<p class="small">No units reporting for this box.</p>{{end}}
58{{end}}
59{{else}}
60<p>No boxes have published metrics yet.</p>
61{{end}}
62{{template "bottom" .}}{{end}}
63