mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-28 05:14:15 +00:00
🔊 verbose error handler
This commit is contained in:
+3
-2
@@ -9,14 +9,15 @@ export function initStats() {
|
||||
|
||||
setInterval(async () => {
|
||||
const [cpuUsed, memory, network] = await Promise.all([osu.cpu.usage(), osu.mem.info(), osu.netstat.inOut()]);
|
||||
var networkUsage = "";
|
||||
if (typeof network === "object") {
|
||||
console.log(`[Network]: in ${network.total.inputMb}mb | out ${network.total.outputMb}mb`);
|
||||
networkUsage = `| [Network]: in ${network.total.inputMb}mb | out ${network.total.outputMb}mb`;
|
||||
}
|
||||
|
||||
console.log(
|
||||
`[CPU] ${cpuUsed.toFixed(2)}% | [Memory] ${Math.round(
|
||||
process.memoryUsage().rss / 1024 / 1024
|
||||
)}mb/${memory.totalMemMb.toFixed(0)}mb`
|
||||
)}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
|
||||
);
|
||||
}, 1000 * 30);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user