Skip to content

Commit

Permalink
misc(proto): convert int32's into DoubleValue in proto (#6332)
Browse files Browse the repository at this point in the history
  • Loading branch information
exterkamp authored and paulirish committed Oct 18, 2018
1 parent 771fb5a commit 3b33497
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/lib/page-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function ultradumbBenchmark() {
}

const durationInSeconds = (Date.now() - start) / 1000;
return iterations / durationInSeconds;
return Math.round(iterations / durationInSeconds);
}

module.exports = {
Expand Down
8 changes: 4 additions & 4 deletions proto/lighthouse-result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ message LighthouseResult {
string host_user_agent = 2;

// The benchmark index that indicates rough device class
int32 benchmark_index = 3;
google.protobuf.DoubleValue benchmark_index = 3;
}

// The environment that the audit was run in
Expand Down Expand Up @@ -110,7 +110,7 @@ message LighthouseResult {
repeated string output = 1;

// The maximum amount of time to wait for loading in ms
int32 max_wait_for_load = 2;
google.protobuf.DoubleValue max_wait_for_load = 2;

// Network throttling options
enum ThrottlingMethod {
Expand All @@ -133,7 +133,7 @@ message LighthouseResult {
// Message containing the throttling settings used in an LH configuration
message Throttling {
// The round trip time in ms
int32 rtt_ms = 1;
google.protobuf.DoubleValue rtt_ms = 1;

// The throughput in kilobytes per second
google.protobuf.DoubleValue throughput_kbps = 2;
Expand All @@ -148,7 +148,7 @@ message LighthouseResult {
google.protobuf.DoubleValue upload_throughput_kbps = 5;

// The amount of slowdown to apply to the cpu
int32 cpu_slowdown_multiplier = 6;
google.protobuf.DoubleValue cpu_slowdown_multiplier = 6;
}

// The throttling settings used
Expand Down
8 changes: 4 additions & 4 deletions proto/sample_v2_round_trip.json
Original file line number Diff line number Diff line change
Expand Up @@ -3244,25 +3244,25 @@
"extraHeaders": null,
"gatherMode": false,
"locale": "en-US",
"maxWaitForLoad": 45000,
"maxWaitForLoad": 45000.0,
"onlyAudits": null,
"onlyCategories": null,
"output": [
"json"
],
"skipAudits": null,
"throttling": {
"cpuSlowdownMultiplier": 4,
"cpuSlowdownMultiplier": 4.0,
"downloadThroughputKbps": 1474.5600000000002,
"requestLatencyMs": 562.5,
"rttMs": 150,
"rttMs": 150.0,
"throughputKbps": 1638.4,
"uploadThroughputKbps": 675.0
},
"throttlingMethod": "devtools"
},
"environment": {
"benchmarkIndex": 1000,
"benchmarkIndex": 1000.0,
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3358.0 Safari/537.36",
"networkUserAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/66.0.3359.30 Mobile Safari/537.36"
},
Expand Down

0 comments on commit 3b33497

Please sign in to comment.