From b5a9eb208763efa027d0b4caae87c515b6f5869b Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 30 Apr 2021 15:42:34 +0200 Subject: [PATCH] fix: moving averages record types (#935) --- src/metrics/stats.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/metrics/stats.js b/src/metrics/stats.js index 23056fac..267f3a2e 100644 --- a/src/metrics/stats.js +++ b/src/metrics/stats.js @@ -6,6 +6,10 @@ const { BigNumber: Big } = require('bignumber.js') const MovingAverage = require('@vascosantos/moving-average') const retimer = require('retimer') +/** + * @typedef {import('@vascosantos/moving-average').IMovingAverage} IMovingAverage + */ + class Stats extends EventEmitter { /** * A queue based manager for stat processing @@ -29,7 +33,7 @@ class Stats extends EventEmitter { this._frequencyLastTime = Date.now() this._frequencyAccumulators = {} - /** @type {{ dataReceived: MovingAverage[], dataSent: MovingAverage[] }} */ + /** @type {{ dataReceived: IMovingAverage[], dataSent: IMovingAverage[] }} */ this._movingAverages = {} this._update = this._update.bind(this)