最近サーバー監視が動かないのを修正 (#88)

This commit is contained in:
MeiMei 2022-02-08 13:05:10 +09:00 committed by GitHub
parent 79dfb9abc4
commit 89a2f5b936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ export default class extends Module {
private check() {
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length;
const cpuPercentages = this.statsLogs.map(s => s && s.cpu_usage * 100 || 0);
const cpuPercentages = this.statsLogs.map(s => s && (s.cpu_usage || s.cpu) * 100 || 0);
const cpuPercentage = average(cpuPercentages);
if (cpuPercentage >= 70) {
this.warn();