diff --git a/.travis.yml b/.travis.yml index 12c5581..879663c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ jobs: - stage: check script: - - npx aegir commitlint --travis - npx aegir dep-check - npm run lint diff --git a/src/stats/stat.js b/src/stats/stat.js index 8513744..18b4a66 100644 --- a/src/stats/stat.js +++ b/src/stats/stat.js @@ -182,7 +182,9 @@ class Stats extends EventEmitter { _updateFrequencyFor (key, timeDiffMS, latestTime) { const count = this._frequencyAccumulators[key] || 0 this._frequencyAccumulators[key] = 0 - const hz = (count / timeDiffMS) * 1000 + // if `timeDiff` is zero, `hz` becomes Infinity, so we fallback to 1ms + const safeTimeDiff = timeDiffMS || 1 + const hz = (count / safeTimeDiff) * 1000 let movingAverages = this._movingAverages[key] if (!movingAverages) {