Skip to content

Commit

Permalink
maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Nov 5, 2021
1 parent ee89953 commit 6c2e95c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ class UnusedBytes extends Audit {
*/
static computeWastedMsWithThroughput(wastedBytes, simulator) {
const bitsPerSecond = simulator.getOptions().throughput;
if (bitsPerSecond === 0) return 0;
const wastedBits = wastedBytes * 8;
const wastedMs = wastedBits / bitsPerSecond * 1000;
return wastedMs;
Expand Down
7 changes: 6 additions & 1 deletion lighthouse-core/computed/load-simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,14 @@ class LoadSimulator {
break;
default:
// intentionally fallback to simulator defaults
break;
return new Simulator(options);
}

// 0 should be interpreted as "unset" for these values.
// Fallback to environment values in this case.
if (options.rtt === 0) options.rtt = networkAnalysis.rtt;
if (options.throughput === 0) options.throughput = networkAnalysis.throughput;

return new Simulator(options);
}

Expand Down

0 comments on commit 6c2e95c

Please sign in to comment.