diff --git a/Source/HTTPServer.js b/Source/HTTPServer.js index 8dfe180..b549be8 100644 --- a/Source/HTTPServer.js +++ b/Source/HTTPServer.js @@ -24,6 +24,9 @@ exports.http = server; app.get("/script",(request, response)=>{ response.sendFile(resolve("./script/index.js")) }); +app.get("/test",(request, response)=>{ + response.sendFile(resolve("./script/test.html")) +}); app.get("/index.js.map",(request, response)=>{ response.sendFile(resolve("./script/index.js.map")) }); diff --git a/Source/IPC.js b/Source/IPC.js index 203d805..2637309 100644 --- a/Source/IPC.js +++ b/Source/IPC.js @@ -20,7 +20,7 @@ process.on('message',data => { break; } case "CLIENT_SEND_MESSAGE":{ - slog("CLIENT_SEND_MESSAGE"); + //slog("CLIENT_SEND_MESSAGE"); let client = Client.clients.get(data.uuid); if(client.isProxy != true) { @@ -164,10 +164,12 @@ function ROOM_DESTROY(room) function mlog(command) { + return; console.log("M",process.pid, command) } function slog(command) { + return; console.log("S",process.pid, command) } diff --git a/Source/Services/DataTransfer.js b/Source/Services/DataTransfer.js index b57d6a6..6de3334 100644 --- a/Source/Services/DataTransfer.js +++ b/Source/Services/DataTransfer.js @@ -87,7 +87,6 @@ addService(({ let {to,pack, handshake,wom} = message; if(Room.rooms.has(to)) { - console.log("Oda da ", Room.rooms.get(to).clients.size,"kişi var") if(!client.rooms.has(to)) { return handshake && end({ diff --git a/Source/stats.js b/Source/stats.js index bd00ffc..fdf776c 100644 --- a/Source/stats.js +++ b/Source/stats.js @@ -1,3 +1,5 @@ +const { mlog } = require("./IPC"); + exports.ws_writed_bytes = 0; exports.ws_readed_bytes = 0; exports.ws_total_bytes = 0; @@ -25,6 +27,7 @@ setInterval(()=>{ ws_recaived_packs: exports.ws_recaived_packs, ws_total_packs: exports.ws_total_packs }) + mlog(`writed ${exports.ws_writed_bytes} bytes, readed ${exports.ws_readed_bytes} bytes`); exports.ws_writed_bytes = 0; exports.ws_readed_bytes = 0; exports.ws_total_bytes = 0; diff --git a/index.js b/index.js index 2180803..e57a966 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ async function main() { if(cluster.isPrimary == false) { - console.log("Slave", process.pid); + console.log("Slave Process PID:", process.pid); // This process is a worker / slave // Compile source code and run require("./Source/index"); @@ -21,12 +21,12 @@ async function main() }; // This process is a primary / master - console.log("Master", process.pid); + console.log("Master Process PID:", process.pid); // Worker process list const master = new Map(); - const coreCount = os.cpus().length; + const coreCount = 3 //os.cpus().length; for(let index = 0; index < coreCount; index++) { // Open slave process diff --git a/script/index.html b/script/index.html index bd34043..9933e70 100644 --- a/script/index.html +++ b/script/index.html @@ -669,7 +669,7 @@ meters.set(core, meter) }; let _meter = meters.get(core); - _meter.update(ws_total_packs,0) + _meter.update(ws_total_packs,ws_total_packs < 30 ? 0 : ws_total_packs < 60 ? 1 : ws_total_packs < 90 ? 2 : 3) } } reloadData(); diff --git a/test.html b/script/test.html similarity index 96% rename from test.html rename to script/test.html index 3cf3de0..1c42d45 100644 --- a/test.html +++ b/script/test.html @@ -9,7 +9,7 @@

- +