fm.js: increase xferSpeed dataset size

This commit is contained in:
Alice Gaudon 2020-06-15 12:22:33 +02:00
parent ec48cda5a7
commit 4495a69205

View File

@ -117,7 +117,7 @@ UploadForm.prototype.updateSpeed = function (loaded) {
if (this.lastTransferTime) { if (this.lastTransferTime) {
this.xferSpeed.push((loaded - this.lastLoaded) / (time - this.lastTransferTime)); this.xferSpeed.push((loaded - this.lastLoaded) / (time - this.lastTransferTime));
if (this.xferSpeed.length > 10) this.xferSpeed = this.xferSpeed.slice(1); if (this.xferSpeed.length > 100) this.xferSpeed = this.xferSpeed.slice(1);
let speed = this.xferSpeed.reduce((v, c) => v + c) / this.xferSpeed.length; let speed = this.xferSpeed.reduce((v, c) => v + c) / this.xferSpeed.length;
let unit = 0; let unit = 0;