summary refs log tree commit diff
path: root/bundle/src/stats.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-25 23:55:19 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-25 23:55:19 +0200
commit4b2e93c84bb65a051a99ddd663518714ba5ed2cf (patch)
tree71f0a88735c4c91a7963db0ab83ac7de9e382478 /bundle/src/stats.ts
parent:bug: message attachment url (diff)
downloadserver-4b2e93c84bb65a051a99ddd663518714ba5ed2cf.tar.xz
:sparkles: add private and public endpoint
Diffstat (limited to '')
-rw-r--r--bundle/src/stats.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/bundle/src/stats.ts b/bundle/src/stats.ts

index 37ddb4e2..e6941db2 100644 --- a/bundle/src/stats.ts +++ b/bundle/src/stats.ts
@@ -9,16 +9,20 @@ export function initStats() { console.log(`[Process] running with pid: ${process.pid}`); setInterval(async () => { - const [cpuUsed, memory, network] = await Promise.all([osu.cpu.usage(), osu.mem.info(), osu.netstat.inOut()]); + const [cpuUsed, memory, network] = await Promise.all([ + osu.cpu.usage(), + osu.mem.info(), + osu.netstat.inOut(), + ]); var networkUsage = ""; if (typeof network === "object") { networkUsage = `| [Network]: in ${network.total.inputMb}mb | out ${network.total.outputMb}mb`; } console.log( - `[CPU] ${cpuUsed.toFixed(2)}% | [Memory] ${Math.round( + `[CPU] ${cpuUsed.toPrecision(3)}% | [Memory] ${Math.round( process.memoryUsage().rss / 1024 / 1024 )}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}` ); - }, 1000 * 30); + }, 1000 * 5); }