Lighthouse: report generated from Lighthouse command line does not contain user timing marks and measures

Created on 18 Mar 2019  路  5Comments  路  Source: GoogleChrome/lighthouse

Lighthouse version: 4.2.0
NPM version: 6.4.1
Node version: 10.13.0
NG version: 6.2.8

Provide the steps to reproduce

  1. run lighthouse from command line to generate performance report on http://localhost:4200/boc-operations/edit/15001900007
    lighthouse http://localhost:4200/boc-operations/edit/15001900007 --port 59020 --output json --output-path=perf-moi-list.json --preset=perf --view --throttling-method provided --disable-storage-reset true --emulated-form-factor desktop --max-wait-for-load 5000

What is the current behavior?

in the generated report, user timing marks and measures in my applications are missing. However, the report generated from running Lighthouse in Chrome DevTools contains the marks and measures.

What is the expected behavior?

I have following code in my component
window.performance.mark('product-list-init')
the report should contain the user timing item such as:
{ "name": "product-list-init", "startTime": 578.116, "timingType": "Mark" }

Environment Information

  • Affected Channels: CLI
  • Lighthouse version: 4.2.0
  • Node.js version: 10.13.0
  • Operating System: Windows 10
needs-more-info

All 5 comments

Thanks for filing @greengalaxy2016! Do you have this page available on a public URL somewhere we can see? We have trouble following repro step 1/auditing your localhost ;)

@patrickhulce I am not allowed to upload the project to github, and the company does not have a public url. I tried against application without authorization and Lighthouse report contains my user timing marks successfully. However, for application with login page, the report via lighthouse CLI does not have my user timing marks, weird enough, the report via chrome devtool contains the marks.
I was hoping you could reproduce by simply adding a one-line code to an application, which has a login page. run lighthouse from CLI and from DevTools to see the difference.

Thanks @greengalaxy2016 for the reports, but those are generated after the part we would need to investigate.

Right now it just sounds like the CLI is just auditing the login page instead of the actual application that has the timing marks. Are you sure you are successfully logging in from the CLI before you run Lighthouse and that the report is actually of the logged in page that produces the timings?

@patrickhulce from the rendering path of the report, I am sure the report is NOT on the login page, but on the specified page. I can also see when lighthouse is running, it does log in and navigate to the specified page.
Actually, after a close look at the report from CLI, I saw the difference: the page was not fully loaded when lighthouse is complete. that was why the marks are not included in the report.
so the question is: I set the --max-wait-for-load as 5000 to wait for Login page to done with loading, how to set another wait time for the specified page to be done loading so that lighthouse won't complete before the page is done loading? Thanks very much!
You can close the ticket as you please

Glad you figured it out! max-wait-for-load at 5000 is very short. It means "hey lighthouse, it doesn't matter if the page looks like it still needs to load, give up after 5s of waiting and start auditing anyway".

It sounds like this is the total opposite of what you want, so I'm not sure what prompted that argument but you should definitely make that number larger. If you want to wait even longer, then you can create a custom config and in the defaultPass set the pauseAfterLoadMs to some high number such that you are sure the page is done loading.

Was this page helpful?
0 / 5 - 0 ratings