From ccb00e218f464f701fb0ffaf32522f200a0fe6c4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Aug 2018 12:38:52 +0900 Subject: [PATCH] Fix bug --- src/modules/server/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/server/index.ts b/src/modules/server/index.ts index f844c53..83424ff 100644 --- a/src/modules/server/index.ts +++ b/src/modules/server/index.ts @@ -54,7 +54,7 @@ export default class ServerModule implements IModule { private check = () => { const average = (arr) => arr.reduce((a, b) => a + b) / arr.length; - const memPercentages = this.statsLogs.map(s => (s.mem.total - s.mem.used) * 100); + const memPercentages = this.statsLogs.map(s => (s.mem.used / s.mem.total) * 100); const memPercentage = average(memPercentages); if (memPercentage >= 90) { this.scheduleReboot('mem');