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-10-18 22:55:54 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-18 22:55:54 +0200
commit6299d45114c401f8b248eece16efb40e2e8b9ed7 (patch)
tree3b02b322046cd47e10a44ccfd6f0f3e44c9c4b70 /bundle/src/stats.ts
parent:bug: fix bulk delete (diff)
downloadserver-6299d45114c401f8b248eece16efb40e2e8b9ed7.tar.xz
:zap: use better-sqlite3 as default db
Diffstat (limited to 'bundle/src/stats.ts')
-rw-r--r--bundle/src/stats.ts35
1 files changed, 18 insertions, 17 deletions
diff --git a/bundle/src/stats.ts b/bundle/src/stats.ts
index 7928de89..9bd9131e 100644
--- a/bundle/src/stats.ts
+++ b/bundle/src/stats.ts
@@ -15,22 +15,23 @@ 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") {
-			networkUsage = `| [Network]: in ${network.total.inputMb}mb | out ${network.total.outputMb}mb`;
-		}
+	// TODO: node-os-utils might have a memory leak, more investigation needed
+	// TODO: doesn't work if spawned with multiple threads
+	// setInterval(async () => {
+	// 	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.toPrecision(3)}% | [Memory] ${Math.round(
-				process.memoryUsage().rss / 1024 / 1024
-			)}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
-		);
-		// TODO: node-os-utils might have a memory leak, more investigation needed
-	}, 1000 * 60 * 5);
+	// 	console.log(
+	// 		`[CPU] ${cpuUsed.toPrecision(3)}% | [Memory] ${Math.round(
+	// 			process.memoryUsage().rss / 1024 / 1024
+	// 		)}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
+	// 	);
+	// }, 1000 * 60 * 5);
 }