lighthouse 8.0.0-dev.20210709 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/architecture.md +101 -0
- package/docs/authenticated-pages.md +44 -0
- package/docs/bug-labels.md +35 -0
- package/docs/configuration.md +213 -0
- package/docs/emulation.md +32 -0
- package/docs/error-reporting.md +42 -0
- package/docs/hacking-tips.md +55 -0
- package/docs/headless-chrome.md +119 -0
- package/docs/lantern.md +55 -0
- package/docs/new-audits.md +99 -0
- package/docs/performance-budgets.md +187 -0
- package/docs/plugins.md +374 -0
- package/docs/puppeteer.md +95 -0
- package/docs/readme.md +164 -0
- package/docs/recipes/auth/README.md +129 -0
- package/docs/recipes/auth/example-lh-auth.js +81 -0
- package/docs/recipes/auth/package.json +11 -0
- package/docs/recipes/auth/server/public/dashboard-unauthenticated.html +21 -0
- package/docs/recipes/auth/server/public/dashboard.html +25 -0
- package/docs/recipes/auth/server/public/home-unauthenticated.html +27 -0
- package/docs/recipes/auth/server/public/home.html +17 -0
- package/docs/recipes/auth/server/public/unauthenticated.html +22 -0
- package/docs/recipes/auth/server/server.js +85 -0
- package/docs/recipes/custom-audit/custom-config.js +36 -0
- package/docs/recipes/custom-audit/package.json +8 -0
- package/docs/recipes/custom-audit/readme.md +32 -0
- package/docs/recipes/custom-audit/searchable-audit.js +46 -0
- package/docs/recipes/custom-audit/searchable-gatherer.js +32 -0
- package/docs/recipes/custom-gatherer-puppeteer/custom-audit.js +34 -0
- package/{root.js → docs/recipes/custom-gatherer-puppeteer/custom-config.js} +23 -2
- package/docs/recipes/custom-gatherer-puppeteer/custom-gatherer.js +51 -0
- package/docs/recipes/custom-gatherer-puppeteer/package.json +13 -0
- package/docs/recipes/custom-gatherer-puppeteer/readme.md +7 -0
- package/docs/recipes/custom-gatherer-puppeteer/test.sh +9 -0
- package/docs/recipes/gulp/gulpfile.js +79 -0
- package/docs/recipes/gulp/package.json +12 -0
- package/docs/recipes/gulp/public/index.html +22 -0
- package/docs/recipes/gulp/readme.md +6 -0
- package/docs/recipes/integration-test/README.md +14 -0
- package/docs/recipes/integration-test/example-lh-auth.test.js +160 -0
- package/docs/recipes/integration-test/package.json +9 -0
- package/docs/recipes/lighthouse-plugin-example/audits/preload-as.js +46 -0
- package/docs/recipes/lighthouse-plugin-example/package.json +11 -0
- package/docs/recipes/lighthouse-plugin-example/plugin-recipe-screenshot.png +0 -0
- package/docs/recipes/lighthouse-plugin-example/plugin.js +24 -0
- package/docs/recipes/lighthouse-plugin-example/readme.md +53 -0
- package/docs/releasing.md +164 -0
- package/docs/scoring.md +79 -0
- package/docs/throttling.md +150 -0
- package/docs/understanding-results.md +209 -0
- package/docs/v8-perf-faq.md +244 -0
- package/docs/variability.md +150 -0
- package/jest.config.js +0 -3
- package/lighthouse-cli/bin.js +8 -6
- package/lighthouse-core/audits/accessibility/aria-command-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +1 -1
- package/lighthouse-core/audits/apple-touch-icon.js +0 -1
- package/lighthouse-core/audits/audit.js +3 -3
- package/lighthouse-core/audits/autocomplete.js +2 -2
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +14 -29
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +2 -3
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +2 -3
- package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +15 -55
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +4 -8
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +8 -15
- package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +9 -10
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +1 -2
- package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +2 -2
- package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +1 -2
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +24 -46
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +1 -1
- package/lighthouse-core/audits/critical-request-chains.js +0 -1
- package/lighthouse-core/audits/csp-xss.js +1 -1
- package/lighthouse-core/audits/diagnostics.js +0 -1
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +0 -1
- package/lighthouse-core/audits/dobetterweb/inspector-issues.js +1 -1
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +0 -1
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +0 -1
- package/lighthouse-core/audits/final-screenshot.js +4 -8
- package/lighthouse-core/audits/font-display.js +0 -1
- package/lighthouse-core/audits/installable-manifest.js +3 -4
- package/lighthouse-core/audits/largest-contentful-paint-element.js +0 -1
- package/lighthouse-core/audits/long-tasks.js +1 -1
- package/lighthouse-core/audits/maskable-icon.js +0 -1
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +2 -4
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +2 -4
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +2 -4
- package/lighthouse-core/audits/metrics/interactive.js +2 -4
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +2 -4
- package/lighthouse-core/audits/metrics/max-potential-fid.js +2 -4
- package/lighthouse-core/audits/metrics/speed-index.js +2 -4
- package/lighthouse-core/audits/metrics/total-blocking-time.js +2 -10
- package/lighthouse-core/audits/metrics.js +2 -4
- package/lighthouse-core/audits/performance-budget.js +0 -1
- package/lighthouse-core/audits/predictive-perf.js +6 -9
- package/lighthouse-core/audits/preload-fonts.js +1 -11
- package/lighthouse-core/audits/preload-lcp-image.js +5 -18
- package/lighthouse-core/audits/redirects.js +8 -10
- package/lighthouse-core/audits/screenshot-thumbnails.js +13 -28
- package/lighthouse-core/audits/seo/canonical.js +1 -2
- package/lighthouse-core/audits/seo/font-size.js +4 -4
- package/lighthouse-core/audits/seo/hreflang.js +2 -3
- package/lighthouse-core/audits/seo/http-status-code.js +16 -21
- package/lighthouse-core/audits/seo/is-crawlable.js +3 -4
- package/lighthouse-core/audits/seo/robots-txt.js +2 -2
- package/lighthouse-core/audits/seo/tap-targets.js +5 -5
- package/lighthouse-core/audits/server-response-time.js +2 -20
- package/lighthouse-core/audits/splash-screen.js +0 -1
- package/lighthouse-core/audits/themed-omnibox.js +0 -1
- package/lighthouse-core/audits/third-party-facades.js +0 -1
- package/lighthouse-core/audits/third-party-summary.js +3 -1
- package/lighthouse-core/audits/timing-budget.js +2 -4
- package/lighthouse-core/audits/uses-rel-preconnect.js +9 -14
- package/lighthouse-core/audits/uses-rel-preload.js +2 -13
- package/lighthouse-core/computed/main-thread-tasks.js +2 -2
- package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +3 -3
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +6 -6
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +8 -9
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +9 -10
- package/lighthouse-core/computed/metrics/interactive.js +24 -25
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-metric.js +8 -16
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +7 -7
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +9 -10
- package/lighthouse-core/computed/metrics/max-potential-fid.js +11 -8
- package/lighthouse-core/computed/metrics/metric.js +5 -32
- package/lighthouse-core/computed/metrics/speed-index.js +5 -6
- package/lighthouse-core/computed/metrics/timing-summary.js +45 -55
- package/lighthouse-core/computed/metrics/total-blocking-time.js +29 -36
- package/lighthouse-core/computed/page-dependency-graph.js +14 -14
- package/lighthouse-core/computed/resource-summary.js +7 -3
- package/lighthouse-core/computed/speedline.js +3 -3
- package/lighthouse-core/computed/trace-of-tab.js +86 -15
- package/lighthouse-core/computed/user-timings.js +5 -5
- package/lighthouse-core/config/default-config.js +0 -1
- package/lighthouse-core/fraggle-rock/config/config.js +7 -9
- package/lighthouse-core/fraggle-rock/config/default-config.js +2 -40
- package/lighthouse-core/fraggle-rock/config/filters.js +6 -39
- package/lighthouse-core/fraggle-rock/config/validation.js +4 -4
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +19 -54
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +10 -21
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +2 -2
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +2 -2
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +2 -2
- package/lighthouse-core/gather/driver/prepare.js +0 -3
- package/lighthouse-core/gather/fetcher.js +2 -0
- package/lighthouse-core/gather/gather-runner.js +14 -2
- package/lighthouse-core/gather/gatherers/image-elements.js +61 -24
- package/lighthouse-core/gather/gatherers/inspector-issues.js +2 -2
- package/lighthouse-core/gather/gatherers/script-elements.js +12 -45
- package/lighthouse-core/gather/gatherers/seo/font-size.js +5 -5
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +12 -64
- package/lighthouse-core/gather/gatherers/service-worker.js +3 -20
- package/lighthouse-core/gather/gatherers/trace-compat.js +1 -1
- package/lighthouse-core/gather/gatherers/trace-elements.js +3 -15
- package/lighthouse-core/gather/gatherers/trace.js +4 -13
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +1 -1
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +2 -13
- package/lighthouse-core/lib/emulation.js +2 -0
- package/lighthouse-core/lib/i18n/i18n.js +2 -2
- package/lighthouse-core/lib/i18n/locales/ar-XB.json +141 -141
- package/lighthouse-core/lib/i18n/locales/ar.json +143 -143
- package/lighthouse-core/lib/i18n/locales/bg.json +143 -143
- package/lighthouse-core/lib/i18n/locales/ca.json +141 -141
- package/lighthouse-core/lib/i18n/locales/cs.json +141 -141
- package/lighthouse-core/lib/i18n/locales/da.json +141 -141
- package/lighthouse-core/lib/i18n/locales/de.json +142 -142
- package/lighthouse-core/lib/i18n/locales/el.json +141 -141
- package/lighthouse-core/lib/i18n/locales/en-GB.json +141 -141
- package/lighthouse-core/lib/i18n/locales/en-US.ctc.json +6659 -0
- package/lighthouse-core/lib/i18n/locales/en-US.json +144 -150
- package/lighthouse-core/lib/i18n/locales/en-XA.json +141 -141
- package/lighthouse-core/lib/i18n/locales/en-XL.ctc.json +6628 -0
- package/lighthouse-core/lib/i18n/locales/en-XL.json +144 -150
- package/lighthouse-core/lib/i18n/locales/es-419.json +141 -141
- package/lighthouse-core/lib/i18n/locales/es.json +141 -141
- package/lighthouse-core/lib/i18n/locales/fi.json +143 -143
- package/lighthouse-core/lib/i18n/locales/fil.json +142 -142
- package/lighthouse-core/lib/i18n/locales/fr.json +141 -141
- package/lighthouse-core/lib/i18n/locales/he.json +142 -142
- package/lighthouse-core/lib/i18n/locales/hi.json +143 -143
- package/lighthouse-core/lib/i18n/locales/hr.json +141 -141
- package/lighthouse-core/lib/i18n/locales/hu.json +143 -143
- package/lighthouse-core/lib/i18n/locales/id.json +143 -143
- package/lighthouse-core/lib/i18n/locales/it.json +143 -143
- package/lighthouse-core/lib/i18n/locales/ja.json +143 -143
- package/lighthouse-core/lib/i18n/locales/ko.json +143 -143
- package/lighthouse-core/lib/i18n/locales/lt.json +143 -143
- package/lighthouse-core/lib/i18n/locales/lv.json +143 -143
- package/lighthouse-core/lib/i18n/locales/nl.json +141 -141
- package/lighthouse-core/lib/i18n/locales/no.json +141 -141
- package/lighthouse-core/lib/i18n/locales/pl.json +141 -141
- package/lighthouse-core/lib/i18n/locales/pt-PT.json +141 -141
- package/lighthouse-core/lib/i18n/locales/pt.json +141 -141
- package/lighthouse-core/lib/i18n/locales/ro.json +144 -144
- package/lighthouse-core/lib/i18n/locales/ru.json +143 -143
- package/lighthouse-core/lib/i18n/locales/sk.json +142 -142
- package/lighthouse-core/lib/i18n/locales/sl.json +141 -141
- package/lighthouse-core/lib/i18n/locales/sr-Latn.json +143 -143
- package/lighthouse-core/lib/i18n/locales/sr.json +143 -143
- package/lighthouse-core/lib/i18n/locales/sv.json +142 -142
- package/lighthouse-core/lib/i18n/locales/ta.json +141 -141
- package/lighthouse-core/lib/i18n/locales/te.json +143 -143
- package/lighthouse-core/lib/i18n/locales/th.json +143 -143
- package/lighthouse-core/lib/i18n/locales/tr.json +143 -143
- package/lighthouse-core/lib/i18n/locales/uk.json +141 -141
- package/lighthouse-core/lib/i18n/locales/vi.json +143 -143
- package/lighthouse-core/lib/i18n/locales/zh-HK.json +141 -141
- package/lighthouse-core/lib/i18n/locales/zh-TW.json +143 -143
- package/lighthouse-core/lib/i18n/locales/zh.json +143 -143
- package/lighthouse-core/lib/lh-error.js +2 -2
- package/lighthouse-core/lib/minify-trace.js +1 -1
- package/lighthouse-core/lib/network-request.js +1 -17
- package/lighthouse-core/lib/page-functions.js +5 -6
- package/lighthouse-core/lib/rect-helpers.js +3 -3
- package/lighthouse-core/lib/sd-validation/assets/jsonldcontext.json +7137 -0
- package/lighthouse-core/lib/sd-validation/assets/schema-tree.json +9900 -0
- package/{report/report-assets.js → lighthouse-core/lib/sd-validation/helpers/walk-object.js} +20 -12
- package/lighthouse-core/lib/sd-validation/json-expander.js +56 -0
- package/lighthouse-core/lib/sd-validation/json-linter.js +49 -0
- package/lighthouse-core/lib/sd-validation/jsonld-keyword-validator.js +50 -0
- package/lighthouse-core/lib/sd-validation/line-number-from-jsonld-path.js +60 -0
- package/lighthouse-core/lib/sd-validation/schema-validator.js +146 -0
- package/lighthouse-core/lib/sd-validation/scripts/download-jsonldcontext.js +30 -0
- package/lighthouse-core/lib/sd-validation/scripts/generate-schema-tree.js +97 -0
- package/lighthouse-core/lib/sd-validation/sd-validation.js +77 -0
- package/lighthouse-core/lib/tappable-rects.js +1 -1
- package/lighthouse-core/lib/tracehouse/trace-processor.js +42 -116
- package/lighthouse-core/lib/url-shim.js +2 -29
- package/lighthouse-core/report/html/html-report-assets.js +38 -0
- package/{report/README.md → lighthouse-core/report/html/readme.md} +11 -7
- package/{report → lighthouse-core/report/html}/renderer/category-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/crc-details-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/details-renderer.js +1 -1
- package/{report → lighthouse-core/report/html}/renderer/dom.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/element-screenshot-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/i18n.js +1 -1
- package/{report → lighthouse-core/report/html}/renderer/logger.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/performance-category-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/psi.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/pwa-category-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/report-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/report-ui-features.js +3 -3
- package/{report → lighthouse-core/report/html}/renderer/snippet-renderer.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/text-encoding.js +0 -0
- package/{report → lighthouse-core/report/html}/renderer/util.js +4 -7
- package/{report/assets/styles.css → lighthouse-core/report/html/report-styles.css} +0 -0
- package/{report/assets/standalone-template.html → lighthouse-core/report/html/report-template.html} +41 -1
- package/{report/assets → lighthouse-core/report/html}/templates.html +0 -0
- package/{report → lighthouse-core/report}/report-generator.js +1 -1
- package/lighthouse-core/runner.js +1 -1
- package/package.json +12 -13
- package/readme.md +2 -2
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +2 -3
- package/third-party/chromium-synchronization/installability-errors-test.js +2 -2
- package/third-party/download-content-shell/download-content-shell.js +1 -2
- package/third-party/snyk/snapshot.json +1 -1
- package/tsconfig.json +1 -0
- package/types/artifacts.d.ts +21 -41
- package/types/audit.d.ts +0 -2
- package/types/config.d.ts +2 -16
- package/types/externs.d.ts +0 -1
- package/types/gatherer.d.ts +13 -13
- package/types/html-renderer.d.ts +14 -14
- package/types/i18n.d.ts +1 -1
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -94
- package/lighthouse-core/computed/image-records.js +0 -62
- package/lighthouse-core/computed/metrics/navigation-metric.js +0 -46
- package/lighthouse-core/computed/processed-navigation.js +0 -21
- package/lighthouse-core/computed/processed-trace.js +0 -21
- package/lighthouse-core/gather/gatherers/gather-context.js +0 -25
- package/lighthouse-core/gather/gatherers/host-form-factor.js +0 -31
- package/lighthouse-core/gather/gatherers/host-user-agent.js +0 -29
- package/lighthouse-core/lib/lh-trace-processor.js +0 -46
- package/report/clients/standalone.js +0 -52
- package/report/test/renderer/category-renderer-test.js +0 -488
- package/report/test/renderer/crc-details-renderer-test.js +0 -115
- package/report/test/renderer/details-renderer-test.js +0 -843
- package/report/test/renderer/dom-test.js +0 -157
- package/report/test/renderer/element-screenshot-renderer-test.js +0 -189
- package/report/test/renderer/i18n-test.js +0 -146
- package/report/test/renderer/performance-category-renderer-test.js +0 -332
- package/report/test/renderer/psi-test.js +0 -152
- package/report/test/renderer/pwa-category-renderer-test.js +0 -303
- package/report/test/renderer/report-renderer-test.js +0 -325
- package/report/test/renderer/report-ui-features-test.js +0 -572
- package/report/test/renderer/snippet-renderer-test.js +0 -291
- package/report/test/renderer/text-encoding-test.js +0 -41
- package/report/test/renderer/util-test.js +0 -388
- package/report/test/report-generator-test.js +0 -145
|
@@ -168,13 +168,13 @@ class LanternFirstContentfulPaint extends LanternMetric {
|
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* @param {Node} dependencyGraph
|
|
171
|
-
* @param {LH.Artifacts.
|
|
171
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
172
172
|
* @return {Node}
|
|
173
173
|
*/
|
|
174
|
-
static getOptimisticGraph(dependencyGraph,
|
|
174
|
+
static getOptimisticGraph(dependencyGraph, traceOfTab) {
|
|
175
175
|
return this.getFirstPaintBasedGraph(
|
|
176
176
|
dependencyGraph,
|
|
177
|
-
|
|
177
|
+
traceOfTab.timestamps.firstContentfulPaint,
|
|
178
178
|
// In the optimistic graph we exclude resources that appeared to be render blocking but were
|
|
179
179
|
// initiated by a script. While they typically have a very high importance and tend to have a
|
|
180
180
|
// significant impact on the page's content, these resources don't technically block rendering.
|
|
@@ -184,13 +184,13 @@ class LanternFirstContentfulPaint extends LanternMetric {
|
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* @param {Node} dependencyGraph
|
|
187
|
-
* @param {LH.Artifacts.
|
|
187
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
188
188
|
* @return {Node}
|
|
189
189
|
*/
|
|
190
|
-
static getPessimisticGraph(dependencyGraph,
|
|
190
|
+
static getPessimisticGraph(dependencyGraph, traceOfTab) {
|
|
191
191
|
return this.getFirstPaintBasedGraph(
|
|
192
192
|
dependencyGraph,
|
|
193
|
-
|
|
193
|
+
traceOfTab.timestamps.firstContentfulPaint,
|
|
194
194
|
node => node.hasRenderBlockingPriority()
|
|
195
195
|
);
|
|
196
196
|
}
|
|
@@ -26,11 +26,11 @@ class LanternFirstMeaningfulPaint extends LanternMetric {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @param {Node} dependencyGraph
|
|
29
|
-
* @param {LH.Artifacts.
|
|
29
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
30
30
|
* @return {Node}
|
|
31
31
|
*/
|
|
32
|
-
static getOptimisticGraph(dependencyGraph,
|
|
33
|
-
const fmp =
|
|
32
|
+
static getOptimisticGraph(dependencyGraph, traceOfTab) {
|
|
33
|
+
const fmp = traceOfTab.timestamps.firstMeaningfulPaint;
|
|
34
34
|
if (!fmp) {
|
|
35
35
|
throw new LHError(LHError.errors.NO_FMP);
|
|
36
36
|
}
|
|
@@ -46,11 +46,11 @@ class LanternFirstMeaningfulPaint extends LanternMetric {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* @param {Node} dependencyGraph
|
|
49
|
-
* @param {LH.Artifacts.
|
|
49
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
50
50
|
* @return {Node}
|
|
51
51
|
*/
|
|
52
|
-
static getPessimisticGraph(dependencyGraph,
|
|
53
|
-
const fmp =
|
|
52
|
+
static getPessimisticGraph(dependencyGraph, traceOfTab) {
|
|
53
|
+
const fmp = traceOfTab.timestamps.firstMeaningfulPaint;
|
|
54
54
|
if (!fmp) {
|
|
55
55
|
throw new LHError(LHError.errors.NO_FMP);
|
|
56
56
|
}
|
|
@@ -41,11 +41,11 @@ class LanternLargestContentfulPaint extends LanternMetric {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @param {Node} dependencyGraph
|
|
44
|
-
* @param {LH.Artifacts.
|
|
44
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
45
45
|
* @return {Node}
|
|
46
46
|
*/
|
|
47
|
-
static getOptimisticGraph(dependencyGraph,
|
|
48
|
-
const lcp =
|
|
47
|
+
static getOptimisticGraph(dependencyGraph, traceOfTab) {
|
|
48
|
+
const lcp = traceOfTab.timestamps.largestContentfulPaint;
|
|
49
49
|
if (!lcp) {
|
|
50
50
|
throw new LHError(LHError.errors.NO_LCP);
|
|
51
51
|
}
|
|
@@ -59,11 +59,11 @@ class LanternLargestContentfulPaint extends LanternMetric {
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* @param {Node} dependencyGraph
|
|
62
|
-
* @param {LH.Artifacts.
|
|
62
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
63
63
|
* @return {Node}
|
|
64
64
|
*/
|
|
65
|
-
static getPessimisticGraph(dependencyGraph,
|
|
66
|
-
const lcp =
|
|
65
|
+
static getPessimisticGraph(dependencyGraph, traceOfTab) {
|
|
66
|
+
const lcp = traceOfTab.timestamps.largestContentfulPaint;
|
|
67
67
|
if (!lcp) {
|
|
68
68
|
throw new LHError(LHError.errors.NO_LCP);
|
|
69
69
|
}
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const BaseNode = require('../../lib/dependency-graph/base-node.js');
|
|
9
9
|
const NetworkRequest = require('../../lib/network-request.js');
|
|
10
|
-
const
|
|
11
|
-
const ProcessedNavigation = require('../processed-navigation.js');
|
|
10
|
+
const TraceOfTab = require('../trace-of-tab.js');
|
|
12
11
|
const PageDependencyGraph = require('../page-dependency-graph.js');
|
|
13
12
|
const LoadSimulator = require('../load-simulator.js');
|
|
14
13
|
|
|
@@ -67,19 +66,19 @@ class LanternMetricArtifact {
|
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* @param {Node} dependencyGraph
|
|
70
|
-
* @param {LH.Artifacts.
|
|
69
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
71
70
|
* @return {Node}
|
|
72
71
|
*/
|
|
73
|
-
static getOptimisticGraph(dependencyGraph,
|
|
72
|
+
static getOptimisticGraph(dependencyGraph, traceOfTab) { // eslint-disable-line no-unused-vars
|
|
74
73
|
throw new Error('Optimistic graph unimplemented!');
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
77
|
* @param {Node} dependencyGraph
|
|
79
|
-
* @param {LH.Artifacts.
|
|
78
|
+
* @param {LH.Artifacts.TraceOfTab} traceOfTab
|
|
80
79
|
* @return {Node}
|
|
81
80
|
*/
|
|
82
|
-
static getPessimisticGraph(dependencyGraph,
|
|
81
|
+
static getPessimisticGraph(dependencyGraph, traceOfTab) { // eslint-disable-line no-unused-vars
|
|
83
82
|
throw new Error('Pessmistic graph unimplemented!');
|
|
84
83
|
}
|
|
85
84
|
|
|
@@ -99,22 +98,15 @@ class LanternMetricArtifact {
|
|
|
99
98
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
100
99
|
*/
|
|
101
100
|
static async computeMetricWithGraphs(data, context, extras) {
|
|
102
|
-
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
|
|
103
|
-
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
|
|
104
101
|
const {trace, devtoolsLog, settings} = data;
|
|
105
|
-
if (gatherContext.gatherMode !== 'navigation') {
|
|
106
|
-
throw new Error(`Lantern metrics can only be computed on navigations`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
102
|
const metricName = this.name.replace('Lantern', '');
|
|
110
103
|
const graph = await PageDependencyGraph.request({trace, devtoolsLog}, context);
|
|
111
|
-
const
|
|
112
|
-
const processedNavigation = await ProcessedNavigation.request(processedTrace, context);
|
|
104
|
+
const traceOfTab = await TraceOfTab.request(trace, context);
|
|
113
105
|
const simulator = data.simulator ||
|
|
114
106
|
await LoadSimulator.request({devtoolsLog, settings}, context);
|
|
115
107
|
|
|
116
|
-
const optimisticGraph = this.getOptimisticGraph(graph,
|
|
117
|
-
const pessimisticGraph = this.getPessimisticGraph(graph,
|
|
108
|
+
const optimisticGraph = this.getOptimisticGraph(graph, traceOfTab);
|
|
109
|
+
const pessimisticGraph = this.getPessimisticGraph(graph, traceOfTab);
|
|
118
110
|
|
|
119
111
|
/** @type {{flexibleOrdering?: boolean, label?: string}} */
|
|
120
112
|
let simulateOptions = {label: `optimistic${metricName}`};
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const makeComputedArtifact = require('../computed-artifact.js');
|
|
13
|
-
const
|
|
13
|
+
const ComputedMetric = require('./metric.js');
|
|
14
14
|
const LHError = require('../../lib/lh-error.js');
|
|
15
15
|
|
|
16
|
-
class LargestContentfulPaintAllFrames extends
|
|
16
|
+
class LargestContentfulPaintAllFrames extends ComputedMetric {
|
|
17
17
|
/**
|
|
18
18
|
* TODO: Simulate LCP all frames in lantern.
|
|
19
19
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
@@ -23,18 +23,18 @@ class LargestContentfulPaintAllFrames extends NavigationMetric {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* @param {LH.Artifacts.
|
|
26
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
27
27
|
* @return {Promise<LH.Artifacts.Metric>}
|
|
28
28
|
*/
|
|
29
29
|
static async computeObservedMetric(data) {
|
|
30
|
-
const {
|
|
31
|
-
if (
|
|
30
|
+
const {traceOfTab} = data;
|
|
31
|
+
if (traceOfTab.timings.largestContentfulPaintAllFrames === undefined) {
|
|
32
32
|
throw new LHError(LHError.errors.NO_LCP_ALL_FRAMES);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return {
|
|
36
|
-
timing:
|
|
37
|
-
timestamp:
|
|
36
|
+
timing: traceOfTab.timings.largestContentfulPaintAllFrames,
|
|
37
|
+
timestamp: traceOfTab.timestamps.largestContentfulPaintAllFrames,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -14,34 +14,33 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const makeComputedArtifact = require('../computed-artifact.js');
|
|
17
|
-
const
|
|
17
|
+
const ComputedMetric = require('./metric.js');
|
|
18
18
|
const LHError = require('../../lib/lh-error.js');
|
|
19
19
|
const LanternLargestContentfulPaint = require('./lantern-largest-contentful-paint.js');
|
|
20
20
|
|
|
21
|
-
class LargestContentfulPaint extends
|
|
21
|
+
class LargestContentfulPaint extends ComputedMetric {
|
|
22
22
|
/**
|
|
23
|
-
* @param {LH.Artifacts.
|
|
23
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
24
24
|
* @param {LH.Artifacts.ComputedContext} context
|
|
25
25
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
26
26
|
*/
|
|
27
27
|
static computeSimulatedMetric(data, context) {
|
|
28
|
-
|
|
29
|
-
return LanternLargestContentfulPaint.request(metricData, context);
|
|
28
|
+
return LanternLargestContentfulPaint.request(data, context);
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
|
-
* @param {LH.Artifacts.
|
|
32
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
34
33
|
* @return {Promise<LH.Artifacts.Metric>}
|
|
35
34
|
*/
|
|
36
35
|
static async computeObservedMetric(data) {
|
|
37
|
-
const {
|
|
38
|
-
if (
|
|
36
|
+
const {traceOfTab} = data;
|
|
37
|
+
if (traceOfTab.timings.largestContentfulPaint === undefined) {
|
|
39
38
|
throw new LHError(LHError.errors.NO_LCP);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
return {
|
|
43
|
-
timing:
|
|
44
|
-
timestamp:
|
|
42
|
+
timing: traceOfTab.timings.largestContentfulPaint,
|
|
43
|
+
timestamp: traceOfTab.timestamps.largestContentfulPaint,
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
}
|
|
@@ -6,30 +6,33 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const makeComputedArtifact = require('../computed-artifact.js');
|
|
9
|
-
const
|
|
9
|
+
const MetricArtifact = require('./metric.js');
|
|
10
10
|
const LanternMaxPotentialFID = require('./lantern-max-potential-fid.js');
|
|
11
|
+
const LHError = require('../../lib/lh-error.js');
|
|
11
12
|
const TracingProcessor = require('../../lib/tracehouse/trace-processor.js');
|
|
12
13
|
|
|
13
|
-
class MaxPotentialFID extends
|
|
14
|
+
class MaxPotentialFID extends MetricArtifact {
|
|
14
15
|
/**
|
|
15
|
-
* @param {LH.Artifacts.
|
|
16
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
16
17
|
* @param {LH.Artifacts.ComputedContext} context
|
|
17
18
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
18
19
|
*/
|
|
19
20
|
static computeSimulatedMetric(data, context) {
|
|
20
|
-
|
|
21
|
-
return LanternMaxPotentialFID.request(metricData, context);
|
|
21
|
+
return LanternMaxPotentialFID.request(data, context);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* @param {LH.Artifacts.
|
|
25
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
26
26
|
* @return {Promise<LH.Artifacts.Metric>}
|
|
27
27
|
*/
|
|
28
28
|
static computeObservedMetric(data) {
|
|
29
|
-
const {firstContentfulPaint} = data.
|
|
29
|
+
const {firstContentfulPaint} = data.traceOfTab.timings;
|
|
30
|
+
if (!firstContentfulPaint) {
|
|
31
|
+
throw new LHError(LHError.errors.NO_FCP);
|
|
32
|
+
}
|
|
30
33
|
|
|
31
34
|
const events = TracingProcessor.getMainThreadTopLevelEvents(
|
|
32
|
-
data.
|
|
35
|
+
data.traceOfTab,
|
|
33
36
|
firstContentfulPaint
|
|
34
37
|
).filter(evt => evt.duration >= 1);
|
|
35
38
|
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const TracingProcessor = require('../../lib/tracehouse/trace-processor.js');
|
|
9
|
-
const
|
|
10
|
-
const ProcessedNavigation = require('../processed-navigation.js');
|
|
9
|
+
const TraceOfTab = require('../trace-of-tab.js');
|
|
11
10
|
const NetworkRecords = require('../network-records.js');
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -19,24 +18,9 @@ const NetworkRecords = require('../network-records.js');
|
|
|
19
18
|
* - Override the computeSimulatedMetric method with the simulated-mode implementation (which
|
|
20
19
|
* may call another computed artifact with the name LanternMyMetricName).
|
|
21
20
|
*/
|
|
22
|
-
class
|
|
21
|
+
class ComputedMetric {
|
|
23
22
|
constructor() {}
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
* Narrows the metric computation data to the input so child metric requests can be cached.
|
|
27
|
-
*
|
|
28
|
-
* @param {LH.Artifacts.MetricComputationData} data
|
|
29
|
-
* @return {LH.Artifacts.MetricComputationDataInput}
|
|
30
|
-
*/
|
|
31
|
-
static getMetricComputationInput(data) {
|
|
32
|
-
return {
|
|
33
|
-
trace: data.trace,
|
|
34
|
-
devtoolsLog: data.devtoolsLog,
|
|
35
|
-
gatherContext: data.gatherContext,
|
|
36
|
-
settings: data.settings,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
24
|
/**
|
|
41
25
|
* @param {LH.Artifacts.MetricComputationData} data
|
|
42
26
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -61,31 +45,20 @@ class Metric {
|
|
|
61
45
|
* @return {Promise<LH.Artifacts.LanternMetric|LH.Artifacts.Metric>}
|
|
62
46
|
*/
|
|
63
47
|
static async compute_(data, context) {
|
|
64
|
-
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
|
|
65
|
-
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
|
|
66
48
|
const {trace, devtoolsLog, settings} = data;
|
|
67
49
|
if (!trace || !devtoolsLog || !settings) {
|
|
68
50
|
throw new Error('Did not provide necessary metric computation data');
|
|
69
51
|
}
|
|
70
52
|
|
|
71
|
-
const processedTrace = await ProcessedTrace.request(trace, context);
|
|
72
|
-
const processedNavigation = await ProcessedNavigation.request(processedTrace, context);
|
|
73
|
-
|
|
74
53
|
const augmentedData = Object.assign({
|
|
75
54
|
networkRecords: await NetworkRecords.request(devtoolsLog, context),
|
|
76
|
-
|
|
77
|
-
processedTrace,
|
|
78
|
-
processedNavigation,
|
|
55
|
+
traceOfTab: await TraceOfTab.request(trace, context),
|
|
79
56
|
}, data);
|
|
80
57
|
|
|
81
|
-
TracingProcessor.assertHasToplevelEvents(augmentedData.
|
|
58
|
+
TracingProcessor.assertHasToplevelEvents(augmentedData.traceOfTab.mainThreadEvents);
|
|
82
59
|
|
|
83
60
|
switch (settings.throttlingMethod) {
|
|
84
61
|
case 'simulate':
|
|
85
|
-
if (gatherContext.gatherMode !== 'navigation') {
|
|
86
|
-
throw new Error(`${gatherContext.gatherMode} does not support throttlingMethod simulate`);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
62
|
return this.computeSimulatedMetric(augmentedData, context);
|
|
90
63
|
case 'provided':
|
|
91
64
|
case 'devtools':
|
|
@@ -96,4 +69,4 @@ class Metric {
|
|
|
96
69
|
}
|
|
97
70
|
}
|
|
98
71
|
|
|
99
|
-
module.exports =
|
|
72
|
+
module.exports = ComputedMetric;
|
|
@@ -6,23 +6,22 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const makeComputedArtifact = require('../computed-artifact.js');
|
|
9
|
-
const
|
|
9
|
+
const ComputedMetric = require('./metric.js');
|
|
10
10
|
const LanternSpeedIndex = require('./lantern-speed-index.js');
|
|
11
11
|
const Speedline = require('../speedline.js');
|
|
12
12
|
|
|
13
|
-
class SpeedIndex extends
|
|
13
|
+
class SpeedIndex extends ComputedMetric {
|
|
14
14
|
/**
|
|
15
|
-
* @param {LH.Artifacts.
|
|
15
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
16
16
|
* @param {LH.Artifacts.ComputedContext} context
|
|
17
17
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
18
18
|
*/
|
|
19
19
|
static computeSimulatedMetric(data, context) {
|
|
20
|
-
|
|
21
|
-
return LanternSpeedIndex.request(metricData, context);
|
|
20
|
+
return LanternSpeedIndex.request(data, context);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
|
-
* @param {LH.Artifacts.
|
|
24
|
+
* @param {LH.Artifacts.MetricComputationData} data
|
|
26
25
|
* @param {LH.Artifacts.ComputedContext} context
|
|
27
26
|
* @return {Promise<LH.Artifacts.Metric>}
|
|
28
27
|
*/
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const ProcessedNavigation = require('../processed-navigation.js');
|
|
8
|
+
const TraceOfTab = require('../trace-of-tab.js');
|
|
10
9
|
const Speedline = require('../speedline.js');
|
|
11
10
|
const FirstContentfulPaint = require('./first-contentful-paint.js');
|
|
12
11
|
const FirstContentfulPaintAllFrames = require('./first-contentful-paint-all-frames.js');
|
|
@@ -24,13 +23,12 @@ class TimingSummary {
|
|
|
24
23
|
/**
|
|
25
24
|
* @param {LH.Trace} trace
|
|
26
25
|
* @param {LH.DevtoolsLog} devtoolsLog
|
|
27
|
-
* @param {LH.Artifacts['GatherContext']} gatherContext
|
|
28
26
|
* @param {ImmutableObject<LH.Config.Settings>} settings
|
|
29
27
|
* @param {LH.Artifacts.ComputedContext} context
|
|
30
28
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
31
29
|
*/
|
|
32
|
-
static async summarize(trace, devtoolsLog,
|
|
33
|
-
const metricComputationData = {trace, devtoolsLog,
|
|
30
|
+
static async summarize(trace, devtoolsLog, settings, context) {
|
|
31
|
+
const metricComputationData = {trace, devtoolsLog, settings};
|
|
34
32
|
/**
|
|
35
33
|
* @template TArtifacts
|
|
36
34
|
* @template TReturn
|
|
@@ -42,21 +40,18 @@ class TimingSummary {
|
|
|
42
40
|
return Artifact.request(artifact, context).catch(_ => undefined);
|
|
43
41
|
};
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const processedTrace = await ProcessedTrace.request(trace, context);
|
|
48
|
-
const processedNavigation = await requestOrUndefined(ProcessedNavigation, processedTrace);
|
|
43
|
+
const traceOfTab = await TraceOfTab.request(trace, context);
|
|
49
44
|
const speedline = await Speedline.request(trace, context);
|
|
50
|
-
const firstContentfulPaint = await
|
|
51
|
-
const firstContentfulPaintAllFrames = await requestOrUndefined(FirstContentfulPaintAllFrames, metricComputationData);
|
|
52
|
-
const firstMeaningfulPaint = await
|
|
53
|
-
const largestContentfulPaint = await requestOrUndefined(LargestContentfulPaint, metricComputationData);
|
|
54
|
-
const largestContentfulPaintAllFrames = await requestOrUndefined(LargestContentfulPaintAllFrames, metricComputationData);
|
|
45
|
+
const firstContentfulPaint = await FirstContentfulPaint.request(metricComputationData, context);
|
|
46
|
+
const firstContentfulPaintAllFrames = await requestOrUndefined(FirstContentfulPaintAllFrames, metricComputationData); // eslint-disable-line max-len
|
|
47
|
+
const firstMeaningfulPaint = await FirstMeaningfulPaint.request(metricComputationData, context);
|
|
48
|
+
const largestContentfulPaint = await requestOrUndefined(LargestContentfulPaint, metricComputationData); // eslint-disable-line max-len
|
|
49
|
+
const largestContentfulPaintAllFrames = await requestOrUndefined(LargestContentfulPaintAllFrames, metricComputationData); // eslint-disable-line max-len
|
|
55
50
|
const interactive = await requestOrUndefined(Interactive, metricComputationData);
|
|
56
51
|
const cumulativeLayoutShiftValues = await requestOrUndefined(CumulativeLayoutShift, trace);
|
|
57
52
|
const maxPotentialFID = await requestOrUndefined(MaxPotentialFID, metricComputationData);
|
|
58
53
|
const speedIndex = await requestOrUndefined(SpeedIndex, metricComputationData);
|
|
59
|
-
const totalBlockingTime = await
|
|
54
|
+
const totalBlockingTime = await TotalBlockingTime.request(metricComputationData, context); // eslint-disable-line max-len
|
|
60
55
|
|
|
61
56
|
const {
|
|
62
57
|
cumulativeLayoutShift,
|
|
@@ -67,50 +62,51 @@ class TimingSummary {
|
|
|
67
62
|
/** @type {LH.Artifacts.TimingSummary} */
|
|
68
63
|
const metrics = {
|
|
69
64
|
// Include the simulated/observed performance metrics
|
|
70
|
-
firstContentfulPaint: firstContentfulPaint
|
|
71
|
-
firstContentfulPaintTs: firstContentfulPaint
|
|
72
|
-
firstContentfulPaintAllFrames: firstContentfulPaintAllFrames && firstContentfulPaintAllFrames.timing,
|
|
73
|
-
firstContentfulPaintAllFramesTs: firstContentfulPaintAllFrames && firstContentfulPaintAllFrames.timestamp,
|
|
74
|
-
firstMeaningfulPaint: firstMeaningfulPaint
|
|
75
|
-
firstMeaningfulPaintTs: firstMeaningfulPaint
|
|
65
|
+
firstContentfulPaint: firstContentfulPaint.timing,
|
|
66
|
+
firstContentfulPaintTs: firstContentfulPaint.timestamp,
|
|
67
|
+
firstContentfulPaintAllFrames: firstContentfulPaintAllFrames && firstContentfulPaintAllFrames.timing, // eslint-disable-line max-len
|
|
68
|
+
firstContentfulPaintAllFramesTs: firstContentfulPaintAllFrames && firstContentfulPaintAllFrames.timestamp, // eslint-disable-line max-len
|
|
69
|
+
firstMeaningfulPaint: firstMeaningfulPaint.timing,
|
|
70
|
+
firstMeaningfulPaintTs: firstMeaningfulPaint.timestamp,
|
|
76
71
|
largestContentfulPaint: largestContentfulPaint && largestContentfulPaint.timing,
|
|
77
72
|
largestContentfulPaintTs: largestContentfulPaint && largestContentfulPaint.timestamp,
|
|
78
|
-
largestContentfulPaintAllFrames: largestContentfulPaintAllFrames && largestContentfulPaintAllFrames.timing,
|
|
79
|
-
largestContentfulPaintAllFramesTs: largestContentfulPaintAllFrames && largestContentfulPaintAllFrames.timestamp,
|
|
73
|
+
largestContentfulPaintAllFrames: largestContentfulPaintAllFrames && largestContentfulPaintAllFrames.timing, // eslint-disable-line max-len
|
|
74
|
+
largestContentfulPaintAllFramesTs: largestContentfulPaintAllFrames && largestContentfulPaintAllFrames.timestamp, // eslint-disable-line max-len
|
|
80
75
|
interactive: interactive && interactive.timing,
|
|
81
76
|
interactiveTs: interactive && interactive.timestamp,
|
|
82
77
|
speedIndex: speedIndex && speedIndex.timing,
|
|
83
78
|
speedIndexTs: speedIndex && speedIndex.timestamp,
|
|
84
|
-
totalBlockingTime: totalBlockingTime
|
|
79
|
+
totalBlockingTime: totalBlockingTime.timing,
|
|
85
80
|
maxPotentialFID: maxPotentialFID && maxPotentialFID.timing,
|
|
86
81
|
cumulativeLayoutShift,
|
|
87
82
|
cumulativeLayoutShiftMainFrame,
|
|
88
83
|
totalCumulativeLayoutShift,
|
|
89
84
|
|
|
90
85
|
// Include all timestamps of interest from trace of tab
|
|
91
|
-
observedTimeOrigin:
|
|
92
|
-
observedTimeOriginTs:
|
|
86
|
+
observedTimeOrigin: traceOfTab.timings.timeOrigin,
|
|
87
|
+
observedTimeOriginTs: traceOfTab.timestamps.timeOrigin,
|
|
93
88
|
// For now, navigationStart is always timeOrigin.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
89
|
+
// These properties might be undefined in a future major version, but preserve them for now.
|
|
90
|
+
observedNavigationStart: traceOfTab.timings.timeOrigin,
|
|
91
|
+
observedNavigationStartTs: traceOfTab.timestamps.timeOrigin,
|
|
92
|
+
observedFirstPaint: traceOfTab.timings.firstPaint,
|
|
93
|
+
observedFirstPaintTs: traceOfTab.timestamps.firstPaint,
|
|
94
|
+
observedFirstContentfulPaint: traceOfTab.timings.firstContentfulPaint,
|
|
95
|
+
observedFirstContentfulPaintTs: traceOfTab.timestamps.firstContentfulPaint,
|
|
96
|
+
observedFirstContentfulPaintAllFrames: traceOfTab.timings.firstContentfulPaintAllFrames,
|
|
97
|
+
observedFirstContentfulPaintAllFramesTs: traceOfTab.timestamps.firstContentfulPaintAllFrames,
|
|
98
|
+
observedFirstMeaningfulPaint: traceOfTab.timings.firstMeaningfulPaint,
|
|
99
|
+
observedFirstMeaningfulPaintTs: traceOfTab.timestamps.firstMeaningfulPaint,
|
|
100
|
+
observedLargestContentfulPaint: traceOfTab.timings.largestContentfulPaint,
|
|
101
|
+
observedLargestContentfulPaintTs: traceOfTab.timestamps.largestContentfulPaint,
|
|
102
|
+
observedLargestContentfulPaintAllFrames: traceOfTab.timings.largestContentfulPaintAllFrames,
|
|
103
|
+
observedLargestContentfulPaintAllFramesTs: traceOfTab.timestamps.largestContentfulPaintAllFrames, // eslint-disable-line max-len
|
|
104
|
+
observedTraceEnd: traceOfTab.timings.traceEnd,
|
|
105
|
+
observedTraceEndTs: traceOfTab.timestamps.traceEnd,
|
|
106
|
+
observedLoad: traceOfTab.timings.load,
|
|
107
|
+
observedLoadTs: traceOfTab.timestamps.load,
|
|
108
|
+
observedDomContentLoaded: traceOfTab.timings.domContentLoaded,
|
|
109
|
+
observedDomContentLoadedTs: traceOfTab.timestamps.domContentLoaded,
|
|
114
110
|
observedCumulativeLayoutShift: cumulativeLayoutShift,
|
|
115
111
|
observedCumulativeLayoutShiftMainFrame: cumulativeLayoutShiftMainFrame,
|
|
116
112
|
observedTotalCumulativeLayoutShift: totalCumulativeLayoutShift,
|
|
@@ -123,24 +119,18 @@ class TimingSummary {
|
|
|
123
119
|
observedSpeedIndex: speedline.speedIndex,
|
|
124
120
|
observedSpeedIndexTs: (speedline.speedIndex + speedline.beginning) * 1000,
|
|
125
121
|
};
|
|
126
|
-
|
|
127
|
-
/* eslint-enable max-len */
|
|
128
|
-
|
|
129
122
|
/** @type {Record<string,boolean>} */
|
|
130
|
-
const debugInfo = {
|
|
131
|
-
lcpInvalidated: !!(processedNavigation && processedNavigation.lcpInvalidated),
|
|
132
|
-
};
|
|
123
|
+
const debugInfo = {lcpInvalidated: traceOfTab.lcpInvalidated};
|
|
133
124
|
|
|
134
125
|
return {metrics, debugInfo};
|
|
135
126
|
}
|
|
136
127
|
/**
|
|
137
|
-
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog,
|
|
128
|
+
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: ImmutableObject<LH.Config.Settings>}} data
|
|
138
129
|
* @param {LH.Artifacts.ComputedContext} context
|
|
139
130
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
140
131
|
*/
|
|
141
132
|
static async compute_(data, context) {
|
|
142
|
-
return TimingSummary.summarize(data.trace, data.devtoolsLog, data.
|
|
143
|
-
context);
|
|
133
|
+
return TimingSummary.summarize(data.trace, data.devtoolsLog, data.settings, context);
|
|
144
134
|
}
|
|
145
135
|
}
|
|
146
136
|
|