Skip to content

Commit

Permalink
Reversed order of samplesize test to match usage by getAverageSliding…
Browse files Browse the repository at this point in the history
…Window() (#3276)
  • Loading branch information
piersoh committed Jun 4, 2020
1 parent f7d4d7c commit a28b83c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/streaming/rules/ThroughputHistory.js
Expand Up @@ -159,7 +159,7 @@ function ThroughputHistory(config) {
} else if (isThroughput) {
// if throughput samples vary a lot, average over a wider sample
for (let i = 1; i < sampleSize; ++i) {
const ratio = arr[i] / arr[i - 1];
const ratio = arr[arr.length - i] / arr[arr.length - i - 1];
if (ratio >= THROUGHPUT_INCREASE_SCALE || ratio <= 1 / THROUGHPUT_DECREASE_SCALE) {
sampleSize += 1;
if (sampleSize === arr.length) { // cannot increase sampleSize beyond arr.length
Expand Down

0 comments on commit a28b83c

Please sign in to comment.