[TASK] One loadavg per core
This commit is contained in:
parent
f3eb100da8
commit
23c267b6c5
@ -149,18 +149,15 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoadBar(v) {
|
function showLoadBar(v, p) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
span.classList.add("bar");
|
span.classList.add("bar");
|
||||||
|
|
||||||
var bar = document.createElement("span");
|
var bar = document.createElement("span");
|
||||||
if (v >= 1) {
|
bar.style.width = ((v * 100) % 100) + "%";
|
||||||
bar.style.width = ((v * 100) % 100) + "%";
|
if (v >= p) {
|
||||||
span.classList.add("warning");
|
span.classList.add("warning");
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
bar.style.width = (v * 100) + "%";
|
|
||||||
}
|
|
||||||
span.appendChild(bar);
|
span.appendChild(bar);
|
||||||
|
|
||||||
var label = document.createElement("label");
|
var label = document.createElement("label");
|
||||||
@ -176,7 +173,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
return function (el) {
|
return function (el) {
|
||||||
el.appendChild(showLoadBar(d.statistics.loadavg.toFixed(2)));
|
el.appendChild(showLoadBar(d.statistics.loadavg.toFixed(2), d.nodeinfo.hardware.nproc));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user