Show cookies from clicking in stats #698

This commit is contained in:
Daniël van Noord
2021-04-03 16:00:00 +02:00
parent bfc54bf9de
commit e1c6f60726
11 changed files with 49 additions and 9 deletions

View File

@@ -50,6 +50,14 @@ export class CMAvgQueue {
}
return ret / time;
}
calcSum(timePeriod) {
let time = timePeriod;
if (time > this.maxLength) time = this.maxLength;
if (time > this.queue.length) time = this.queue.length;
if (time === 0) return 0;
return this.queue.slice(-time).reduce((a, b) => a + b, 0);
}
}
/**