Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/.nvm/versions/node/v18.17.1/lib/node_modules/pm2/node_modules/tx2/src/utils/probes/ drwxr-xr-x |
Viewing file: Select action/file-type: var units = require('./units'); module.exports = ExponentiallyWeightedMovingAverage; function ExponentiallyWeightedMovingAverage(timePeriod, tickInterval) { this._timePeriod = timePeriod || 1 * units.MINUTE; this._tickInterval = tickInterval || ExponentiallyWeightedMovingAverage.TICK_INTERVAL; this._alpha = 1 - Math.exp(-this._tickInterval / this._timePeriod); this._count = 0; this._rate = 0; }; ExponentiallyWeightedMovingAverage.TICK_INTERVAL = 5 * units.SECONDS; ExponentiallyWeightedMovingAverage.prototype.update = function(n) { this._count += n; }; ExponentiallyWeightedMovingAverage.prototype.tick = function() { var instantRate = this._count / this._tickInterval; this._count = 0; this._rate += (this._alpha * (instantRate - this._rate)); }; ExponentiallyWeightedMovingAverage.prototype.rate = function(timeUnit) { return (this._rate || 0) * timeUnit; }; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0032 ]-- |