This commit is contained in:
syuilo 2018-08-12 12:38:52 +09:00
parent 6037e49b01
commit ccb00e218f

View file

@ -54,7 +54,7 @@ export default class ServerModule implements IModule {
private check = () => { private check = () => {
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length; 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); const memPercentage = average(memPercentages);
if (memPercentage >= 90) { if (memPercentage >= 90) {
this.scheduleReboot('mem'); this.scheduleReboot('mem');