2015-01-23 17:40:48 +00:00
{{ template "head" . }}
2014-11-20 18:41:25 +00:00
2015-01-23 17:40:48 +00:00
{{ template "prom_right_table_head" }}
2014-11-20 18:41:25 +00:00
< tr > < th colspan = "2" > CPU< / th > < / tr >
2015-01-23 17:40:48 +00:00
{{ range printf "sum by (mode)(rate(node_cpu{job='node',instance='%s'}[5m])) * 100 / scalar(count(count by (cpu)(node_cpu{job='node',instance='%s'})))" .Params.instance .Params.instance | query | sortByLabel "mode" }}
2014-11-20 18:41:25 +00:00
< tr >
< td > {{ .Labels.mode | title }} CPU< / td >
< td > {{ .Value | printf "%.3g" }}%< / td >
< / tr >
{{ end }}
< tr > < th colspan = "2" > Misc< / th > < / tr >
< tr >
< td > Processes Running< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_procs_running{job='node',instance='%s'}" .Params.instance) "" "humanize") }}< / td >
< / tr >
< tr >
< td > Processes Blocked< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_procs_blocked{job='node',instance='%s'}" .Params.instance) "" "humanize") }}< / td >
< / tr >
< tr >
< td > Forks< / td >
< td > {{ template "prom_query_drilldown" (args (printf "rate(node_forks{job='node',instance='%s'}[5m])" .Params.instance) "/s" "humanize") }}< / td >
< / tr >
< tr >
< td > Context Switches< / td >
< td > {{ template "prom_query_drilldown" (args (printf "rate(node_context_switches{job='node',instance='%s'}[5m])" .Params.instance) "/s" "humanize") }}< / td >
< / tr >
< tr >
< td > Interrupts< / td >
< td > {{ template "prom_query_drilldown" (args (printf "rate(node_intr{job='node',instance='%s'}[5m])" .Params.instance) "/s" "humanize") }}< / td >
< / tr >
< tr >
< td > 1m Loadavg< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_load1{job='node',instance='%s'}" .Params.instance)) }}< / td >
< / tr >
< tr >
< / tr >
2015-01-23 17:40:48 +00:00
{{ template "prom_right_table_tail" }}
2014-11-20 18:41:25 +00:00
2015-01-23 17:40:48 +00:00
{{ template "prom_content_head" . }}
2014-11-20 18:41:25 +00:00
< h1 > Node CPU - {{ reReplaceAll "(.*?://)([^:/]+?)(:\\d+)?/.*" "$2" .Params.instance }}< / h1 >
< h3 > CPU Usage< / h3 >
< div id = "cpuGraph" > < / div >
< script >
new PromConsole.Graph({
node: document.querySelector("#cpuGraph"),
2015-01-23 17:40:48 +00:00
expr: "sum by (mode)(rate(node_cpu{job='node',instance='{{ .Params.instance }}',mode!='idle'}[5m]))",
2014-11-20 18:41:25 +00:00
renderer: 'area',
2015-01-23 17:40:48 +00:00
max: {{ with printf "count(count by (cpu)(node_cpu{job='node',instance='%s'}))" .Params.instance | query }}{{ . | first | value }}{{ else}}undefined{{end}},
2014-11-20 18:41:25 +00:00
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yTitle: 'Cores'
})
< / script >
2015-01-23 17:40:48 +00:00
{{ template "prom_content_tail" . }}
2014-11-20 18:41:25 +00:00
2015-01-23 17:40:48 +00:00
{{ template "tail" }}