Impruvement statics
This commit is contained in:
parent
6c2fb5eb68
commit
f3efd6454e
|
@ -40,8 +40,6 @@ setInterval(()=>{
|
||||||
exports.ws_sended_packs = 0;
|
exports.ws_sended_packs = 0;
|
||||||
exports.ws_recaived_packs = 0;
|
exports.ws_recaived_packs = 0;
|
||||||
exports.ws_total_packs = 0;
|
exports.ws_total_packs = 0;
|
||||||
exports.mwse_rooms = 0;
|
|
||||||
exports.mwse_clients = 0;
|
|
||||||
process.send({
|
process.send({
|
||||||
core: "readstat",
|
core: "readstat",
|
||||||
ws_writed_bytes: exports.ws_writed_bytes,
|
ws_writed_bytes: exports.ws_writed_bytes,
|
||||||
|
@ -60,4 +58,4 @@ process.on('message', stat => {
|
||||||
{
|
{
|
||||||
exports.others = stat.data;
|
exports.others = stat.data;
|
||||||
}
|
}
|
||||||
})
|
})
|
4
index.js
4
index.js
|
@ -62,7 +62,9 @@ async function main()
|
||||||
ws_total_bytes:e.ws_total_bytes,
|
ws_total_bytes:e.ws_total_bytes,
|
||||||
ws_sended_packs:e.ws_sended_packs,
|
ws_sended_packs:e.ws_sended_packs,
|
||||||
ws_recaived_packs:e.ws_recaived_packs,
|
ws_recaived_packs:e.ws_recaived_packs,
|
||||||
ws_total_packs:e.ws_total_packs
|
ws_total_packs:e.ws_total_packs,
|
||||||
|
mwse_rooms: e.mwse_rooms,
|
||||||
|
mwse_clients: e.mwse_clients
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
<div class="speed-container">
|
<div class="speed-container">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="connection-container">
|
|
||||||
<h1>Active R1: <span id="roomCount">0</span> R2: <span id="connectionCount">0</span></h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
html,body,#container{
|
html,body,#container{
|
||||||
|
@ -30,15 +27,6 @@
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: auto;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.connection-container{
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-bottom: auto;
|
|
||||||
text-align: center;
|
|
||||||
font-family: system-ui;
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
.speed-container > div{
|
.speed-container > div{
|
||||||
flex: 1 1 25%;
|
flex: 1 1 25%;
|
||||||
|
@ -55,6 +43,13 @@
|
||||||
color: white;
|
color: white;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
.speed-container > div .mwse{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
.speed-container > div .text > .text1{
|
.speed-container > div .text > .text1{
|
||||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
|
@ -594,24 +589,40 @@
|
||||||
text.classList.add("text")
|
text.classList.add("text")
|
||||||
text1.classList.add("text1")
|
text1.classList.add("text1")
|
||||||
text2.classList.add("text2")
|
text2.classList.add("text2")
|
||||||
|
|
||||||
|
let mwse = document.createElement("div");
|
||||||
|
let text3 = document.createElement("span");
|
||||||
|
let text4 = document.createElement("span");
|
||||||
|
mwse.classList.add("mwse")
|
||||||
|
text3.classList.add("text3")
|
||||||
|
text4.classList.add("text4")
|
||||||
|
|
||||||
text.append(text1);
|
text.append(text1);
|
||||||
text.append(text2);
|
text.append(text2);
|
||||||
|
|
||||||
|
mwse.append(text3);
|
||||||
|
mwse.append(text4);
|
||||||
|
|
||||||
canvas.setAttribute("width", "440px");
|
canvas.setAttribute("width", "440px");
|
||||||
canvas.setAttribute("height", "220px");
|
canvas.setAttribute("height", "220px");
|
||||||
container.append(canvas);
|
container.append(canvas);
|
||||||
container.append(text);
|
container.append(text);
|
||||||
|
container.append(mwse);
|
||||||
createCanvas.value = canvas;
|
createCanvas.value = canvas;
|
||||||
createCanvas.container = container;
|
createCanvas.container = container;
|
||||||
createCanvas.ps = text1;
|
createCanvas.ps = text1;
|
||||||
createCanvas.pw = text2;
|
createCanvas.pw = text2;
|
||||||
|
createCanvas.rooms = text3;
|
||||||
|
createCanvas.clients = text4;
|
||||||
return container;
|
return container;
|
||||||
};
|
};
|
||||||
function update(value, pressure)
|
function update(value, pressure, rooms, clients)
|
||||||
{
|
{
|
||||||
iTargetSpeed = value;
|
iTargetSpeed = value;
|
||||||
createCanvas.ps.innerText = value;
|
createCanvas.ps.innerText = value;
|
||||||
createCanvas.pw.innerText = pressure + '%';
|
createCanvas.pw.innerText = pressure + '%';
|
||||||
|
createCanvas.rooms.innerText = rooms;
|
||||||
|
createCanvas.clients.innerText = clients;
|
||||||
draw()
|
draw()
|
||||||
}
|
}
|
||||||
function convertSpeedToAngle(options) {
|
function convertSpeedToAngle(options) {
|
||||||
|
@ -672,7 +683,9 @@
|
||||||
}).then(e => e.json());
|
}).then(e => e.json());
|
||||||
for (const {
|
for (const {
|
||||||
ws_total_packs,
|
ws_total_packs,
|
||||||
core
|
core,
|
||||||
|
mwse_rooms,
|
||||||
|
mwse_clients
|
||||||
} of response) {
|
} of response) {
|
||||||
if(!meters.has(core))
|
if(!meters.has(core))
|
||||||
{
|
{
|
||||||
|
@ -682,7 +695,12 @@
|
||||||
meters.set(core, meter)
|
meters.set(core, meter)
|
||||||
};
|
};
|
||||||
let _meter = meters.get(core);
|
let _meter = meters.get(core);
|
||||||
_meter.update(ws_total_packs,ws_total_packs < 30 ? 0 : ws_total_packs < 60 ? 1 : ws_total_packs < 90 ? 2 : 3)
|
_meter.update(
|
||||||
|
ws_total_packs,
|
||||||
|
ws_total_packs < 30 ? 0 : ws_total_packs < 60 ? 1 : ws_total_packs < 90 ? 2 : 3,
|
||||||
|
"RM: "+mwse_rooms,
|
||||||
|
"CL: "+mwse_clients
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reloadData();
|
reloadData();
|
||||||
|
|
Loading…
Reference in New Issue