最近サーバー監視が動かないのを修正 (#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

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();