Impruvement statics

This commit is contained in:
Abdussamed 2023-06-05 10:18:38 +03:00
parent 6c2fb5eb68
commit f3efd6454e
3 changed files with 37 additions and 19 deletions

View File

@ -40,8 +40,6 @@ setInterval(()=>{
exports.ws_sended_packs = 0;
exports.ws_recaived_packs = 0;
exports.ws_total_packs = 0;
exports.mwse_rooms = 0;
exports.mwse_clients = 0;
process.send({
core: "readstat",
ws_writed_bytes: exports.ws_writed_bytes,
@ -60,4 +58,4 @@ process.on('message', stat => {
{
exports.others = stat.data;
}
})
})

View File

@ -62,7 +62,9 @@ async function main()
ws_total_bytes:e.ws_total_bytes,
ws_sended_packs:e.ws_sended_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
}
})
})

View File

@ -11,9 +11,6 @@
<div class="speed-container">
</div>
<div class="connection-container">
<h1>Active R1: <span id="roomCount">0</span> R2: <span id="connectionCount">0</span></h1>
</div>
</div>
<style>
html,body,#container{
@ -30,15 +27,6 @@
max-width: 1200px;
flex-wrap: wrap;
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{
flex: 1 1 25%;
@ -55,6 +43,13 @@
color: white;
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{
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 2em;
@ -594,24 +589,40 @@
text.classList.add("text")
text1.classList.add("text1")
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(text2);
mwse.append(text3);
mwse.append(text4);
canvas.setAttribute("width", "440px");
canvas.setAttribute("height", "220px");
container.append(canvas);
container.append(text);
container.append(mwse);
createCanvas.value = canvas;
createCanvas.container = container;
createCanvas.ps = text1;
createCanvas.pw = text2;
createCanvas.rooms = text3;
createCanvas.clients = text4;
return container;
};
function update(value, pressure)
function update(value, pressure, rooms, clients)
{
iTargetSpeed = value;
createCanvas.ps.innerText = value;
createCanvas.pw.innerText = pressure + '%';
createCanvas.rooms.innerText = rooms;
createCanvas.clients.innerText = clients;
draw()
}
function convertSpeedToAngle(options) {
@ -672,7 +683,9 @@
}).then(e => e.json());
for (const {
ws_total_packs,
core
core,
mwse_rooms,
mwse_clients
} of response) {
if(!meters.has(core))
{
@ -682,7 +695,12 @@
meters.set(core, meter)
};
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();