Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(lantern): rebase #10129

Merged
merged 3 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lighthouse-core/audits/predictive-perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const LanternInteractive = require('../computed/metrics/lantern-interactive.js')
const LanternFirstCPUIdle = require('../computed/metrics/lantern-first-cpu-idle.js');
const LanternSpeedIndex = require('../computed/metrics/lantern-speed-index.js');
const LanternEil = require('../computed/metrics/lantern-estimated-input-latency.js');
// TODO: we don't have LCP in the lantern test yet. https://github.com/GoogleChrome/lighthouse/issues/9953
// const LanternLcp = require('../computed/metrics/lantern-largest-contentful-paint.js');
const LanternLcp = require('../computed/metrics/lantern-largest-contentful-paint.js');

// Parameters (in ms) for log-normal CDF scoring. To see the curve:
// https://www.desmos.com/calculator/rjp0lbit8y
Expand Down Expand Up @@ -55,7 +54,7 @@ class PredictivePerf extends Audit {
const ttfcpui = await LanternFirstCPUIdle.request({trace, devtoolsLog, settings}, context);
const si = await LanternSpeedIndex.request({trace, devtoolsLog, settings}, context);
const eil = await LanternEil.request({trace, devtoolsLog, settings}, context);
// const lcp = await LanternLcp.request({trace, devtoolsLog, settings}, context);
const lcp = await LanternLcp.request({trace, devtoolsLog, settings}, context);

const values = {
roughEstimateOfFCP: fcp.timing,
Expand All @@ -82,9 +81,9 @@ class PredictivePerf extends Audit {
optimisticEIL: eil.optimisticEstimate.timeInMs,
pessimisticEIL: eil.pessimisticEstimate.timeInMs,

// roughEstimateOfLCP: lcp.timing,
// optimisticLCP: lcp.optimisticEstimate.timeInMs,
// pessimisticLCP: lcp.pessimisticEstimate.timeInMs,
roughEstimateOfLCP: lcp.timing,
optimisticLCP: lcp.optimisticEstimate.timeInMs,
pessimisticLCP: lcp.pessimisticEstimate.timeInMs,
};

const score = Audit.computeLogNormalScore(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ echo " $ sudo -u lighthouse tail -f /home/lighthouse/collect.log"

echo "When complete run..."
echo " $ gcloud --project="$CLOUDSDK_CORE_PROJECT" compute scp lantern-collect-instance:/home/lighthouse/src/lighthouse/dist/collect-lantern-traces.zip ./collect-lantern-traces.zip"
echo " $ gcloud --project="$CLOUDSDK_CORE_PROJECT" compute scp lantern-collect-instance:/home/lighthouse/src/lighthouse/dist/golden-lantern-traces.zip ./golden-lantern-traces.zip"
echo " $ gcloud --project="$CLOUDSDK_CORE_PROJECT" compute instances delete lantern-collect-instance"
3 changes: 3 additions & 0 deletions lighthouse-core/scripts/lantern/collect/gcp-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ source /home/lighthouse/.env
# Run the collection
DEBUG=1 node --max-old-space-size=4096 ./lighthouse-core/scripts/lantern/collect/collect.js

# Create golden
DEBUG=1 node --max-old-space-size=4096 ./lighthouse-core/scripts/lantern/collect/golden.js

# Kill xvfb
kill $!
8 changes: 4 additions & 4 deletions lighthouse-core/scripts/lantern/download-traces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -e

VERSION="2017-12-06"
VERSION="2019-12-17"

DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LH_ROOT_PATH="$DIRNAME/../../.."
Expand All @@ -29,7 +29,7 @@ rm -rf lantern-data/
mkdir -p lantern-data/ && cd lantern-data
echo $VERSION > version

curl -o lantern-traces.tar.gz -L https://storage.googleapis.com/lh-lantern-data/lantern-traces-$VERSION.tar.gz
curl -o golden-lantern-traces.zip -L https://storage.googleapis.com/lh-lantern-data/golden-lantern-traces-$VERSION.zip
Copy link
Collaborator Author

@connorjclark connorjclark Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed file b/c we are also keeping the big zip files in this bucket, and I wanted to reuse the naming that the collection scripts use.


tar -xzf lantern-traces.tar.gz
rm lantern-traces.tar.gz
unzip -q golden-lantern-traces.zip
rm golden-lantern-traces.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

exports[`Performance: predictive performance audit should compute the predicted values 1`] = `
Object {
"optimisticEIL": 93,
"optimisticFCP": 1307,
"optimisticFMP": 1439,
"optimisticSI": 605,
"optimisticTTFCPUI": 3351,
"optimisticTTI": 3351,
"pessimisticEIL": 101,
"pessimisticFCP": 1307,
"pessimisticFMP": 1583,
"pessimisticSI": 1631,
"pessimisticTTFCPUI": 3502,
"pessimisticTTI": 3502,
"roughEstimateOfEIL": 78,
"roughEstimateOfFCP": 1307,
"roughEstimateOfFMP": 1511,
"roughEstimateOfSI": 1657,
"roughEstimateOfTTFCPUI": 3351,
"roughEstimateOfTTI": 3427,
"optimisticEIL": 455,
"optimisticFCP": 2252,
"optimisticFMP": 2252,
"optimisticLCP": 3192,
"optimisticSI": 1393,
"optimisticTTFCPUI": 3677,
"optimisticTTI": 3677,
"pessimisticEIL": 903,
"pessimisticFCP": 2252,
"pessimisticFMP": 3191,
"pessimisticLCP": 3495,
"pessimisticSI": 2981,
"pessimisticTTFCPUI": 5551,
"pessimisticTTI": 5551,
"roughEstimateOfEIL": 543,
"roughEstimateOfFCP": 2252,
"roughEstimateOfFMP": 2721,
"roughEstimateOfLCP": 3343,
"roughEstimateOfSI": 3639,
"roughEstimateOfTTFCPUI": 3677,
"roughEstimateOfTTI": 4614,
}
`;
4 changes: 2 additions & 2 deletions lighthouse-core/test/audits/predictive-perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

const PredictivePerf = require('../../audits/predictive-perf.js');

const acceptableTrace = require('../fixtures/traces/progressive-app-m60.json');
const acceptableDevToolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const acceptableTrace = require('../fixtures/traces/lcp-m78.json');
const acceptableDevToolsLog = require('../fixtures/traces/lcp-m78.devtools.log.json');

/* eslint-env jest */
describe('Performance: predictive performance audit', () => {
Expand Down
Loading