1
0
Fork 0
mirror of https://github.com/syuilo/ai.git synced 2025-03-25 21:12:56 +00:00

feat: console出力

This commit is contained in:
n1lsqn 2023-11-13 21:41:07 +09:00
parent 5e2e700e05
commit fd699e8316

View file

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