From 05e6713fcf7594a98d0be3c21e0bbb834f9244a9 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 2 Nov 2021 16:11:13 -0700 Subject: [PATCH] misc(proto): add throttling and throttling_method (#13309) --- lighthouse-core/lib/proto-preprocessor.js | 16 +++++++++++-- proto/lighthouse-result.proto | 29 ++++++++++++++++++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/lib/proto-preprocessor.js b/lighthouse-core/lib/proto-preprocessor.js index 62893724eb71..bb465c2dd1bb 100644 --- a/lighthouse-core/lib/proto-preprocessor.js +++ b/lighthouse-core/lib/proto-preprocessor.js @@ -29,10 +29,22 @@ function processForProto(lhr) { // 'ignore unknown fields' in the language of conversion. if (reportJson.configSettings) { // The settings that are in both proto and LHR - const {formFactor, locale, onlyCategories, channel} = reportJson.configSettings; + const { + formFactor, + locale, + onlyCategories, + channel, + throttling, + throttlingMethod} = reportJson.configSettings; // @ts-expect-error - intentionally only a subset of settings. - reportJson.configSettings = {formFactor, locale, onlyCategories, channel}; + reportJson.configSettings = { + formFactor, + locale, + onlyCategories, + channel, + throttling, + throttlingMethod}; } // Remove runtimeError if it is NO_ERROR diff --git a/proto/lighthouse-result.proto b/proto/lighthouse-result.proto index 1df868de6d87..63b83e95ab8a 100644 --- a/proto/lighthouse-result.proto +++ b/proto/lighthouse-result.proto @@ -126,7 +126,7 @@ message LighthouseResult { map category_groups = 11; // Message containing the configuration settings for the LH run - // Next field number: 6 + // Next ID: 9 message ConfigSettings { // The possible form factors an audit can be run in. // This enum served the emulated_form_factor field, but in v7, that field @@ -158,6 +158,33 @@ message LighthouseResult { // How Lighthouse was run, e.g. from the Chrome extension or from the npm // module string channel = 4; + + // Next ID: 7 + message ThrottlingSettings { + // The round trip time in milliseconds. + double rtt_ms = 1; + + // The network throughput in kilobits per second. + double throughput_kbps = 2; + + // The network request latency in milliseconds. + double request_latency_ms = 3; + + // The network download throughput in kilobits per second. + double download_throughput_kbps = 4; + + // The network upload throughput in kilobits per second. + double upload_throughput_kbps = 5; + + // The amount of slowdown applied to the cpu (1/). + double cpu_slowdown_multiplier = 6; + } + + // The throttling config settings. + ThrottlingSettings throttling = 7; + + // The method used to throttle the network. + string throttling_method = 8; } // The settings that were used to run this audit