mirror of
https://github.com/syuilo/ai.git
synced 2024-11-21 20:58:00 +00:00
最近サーバー監視が動かないのを修正 (#88)
This commit is contained in:
parent
79dfb9abc4
commit
89a2f5b936
|
@ -39,7 +39,7 @@ export default class extends Module {
|
||||||
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 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);
|
const cpuPercentage = average(cpuPercentages);
|
||||||
if (cpuPercentage >= 70) {
|
if (cpuPercentage >= 70) {
|
||||||
this.warn();
|
this.warn();
|
||||||
|
|
Loading…
Reference in a new issue