mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-04-29 09:07:16 +09:00
parent
a12e8ccb15
commit
ce6bd6a7c3
@ -38,7 +38,7 @@ export default class ServerModule implements IModule {
|
|||||||
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.cpu_usage * 100);
|
const cpuPercentages = this.statsLogs.map(s => s && s.cpu_usage * 100 || 0);
|
||||||
const cpuPercentage = average(cpuPercentages);
|
const cpuPercentage = average(cpuPercentages);
|
||||||
if (cpuPercentage >= 70) {
|
if (cpuPercentage >= 70) {
|
||||||
this.warn();
|
this.warn();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user