mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
commit
a0374b786a
1 changed files with 1 additions and 0 deletions
|
@ -39,6 +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;
|
||||||
|
|
||||||
|
console.log('statsLogs', this.statsLogs)
|
||||||
const cpuPercentages = this.statsLogs.map(s => s && (s.cpu_usage || s.cpu) * 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) {
|
||||||
|
|
Loading…
Reference in a new issue