From cf595d9d8e0ec05c9c5890bff76937b847121819 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Wed, 8 May 2019 16:06:15 -0700 Subject: [PATCH] core(performance-budget): add MP-FID as budget metric --- lighthouse-cli/test/smokehouse/perf/perf-config.js | 2 +- lighthouse-core/config/budget.js | 2 +- lighthouse-core/test/results/sample-config.js | 2 +- lighthouse-core/test/results/sample_v2.json | 2 +- types/budget.d.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/perf/perf-config.js b/lighthouse-cli/test/smokehouse/perf/perf-config.js index 6b22341a9df2..f253a05022d3 100644 --- a/lighthouse-cli/test/smokehouse/perf/perf-config.js +++ b/lighthouse-cli/test/smokehouse/perf/perf-config.js @@ -41,7 +41,7 @@ const perfConfig = { {metric: 'first-cpu-idle', budget: 2000, tolerance: 100}, {metric: 'interactive', budget: 2000, tolerance: 100}, {metric: 'first-meaningful-paint', budget: 2000, tolerance: 100}, - {metric: 'estimated-input-latency', budget: 2000, tolerance: 100}, + {metric: 'max-potential-fid', budget: 2000, tolerance: 100}, ], }], }, diff --git a/lighthouse-core/config/budget.js b/lighthouse-core/config/budget.js index e788e8f49a2f..8ed85a12b42e 100644 --- a/lighthouse-core/config/budget.js +++ b/lighthouse-core/config/budget.js @@ -94,7 +94,7 @@ class Budget { 'first-cpu-idle', 'interactive', 'first-meaningful-paint', - 'estimated-input-latency', + 'max-potential-fid', ]; // Assume metric is an allowed string, throw if not. if (!validTimingMetrics.includes(/** @type {LH.Budget.TimingMetric} */ (metric))) { diff --git a/lighthouse-core/test/results/sample-config.js b/lighthouse-core/test/results/sample-config.js index 9f8144dbb57c..8f63818ceebe 100644 --- a/lighthouse-core/test/results/sample-config.js +++ b/lighthouse-core/test/results/sample-config.js @@ -42,7 +42,7 @@ const budgetedConfig = { {metric: 'first-cpu-idle', budget: 2900, tolerance: 100}, {metric: 'interactive', budget: 2900, tolerance: 100}, {metric: 'first-meaningful-paint', budget: 2000, tolerance: 100}, - {metric: 'estimated-input-latency', budget: 100, tolerance: 100}, + {metric: 'max-potential-fid', budget: 100, tolerance: 100}, ], }], }, diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 19844e8e8249..89e0bd6c6372 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -3290,7 +3290,7 @@ "tolerance": 100 }, { - "metric": "estimated-input-latency", + "metric": "max-potential-fid", "budget": 100, "tolerance": 100 } diff --git a/types/budget.d.ts b/types/budget.d.ts index fa8632f1b8d4..4c1d058b21ae 100644 --- a/types/budget.d.ts +++ b/types/budget.d.ts @@ -37,7 +37,7 @@ declare global { } /** Supported timing metrics. */ - export type TimingMetric = 'first-contentful-paint' | 'first-cpu-idle' | 'interactive' | 'first-meaningful-paint' | 'estimated-input-latency'; + export type TimingMetric = 'first-contentful-paint' | 'first-cpu-idle' | 'interactive' | 'first-meaningful-paint' | 'max-potential-fid'; /** Supported values for the resourceType property of a ResourceBudget. */ export type ResourceType = 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'document' | 'other' | 'total' | 'third-party';