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

misc: timings script #9723

Merged
merged 20 commits into from
Oct 2, 2019
Merged

misc: timings script #9723

merged 20 commits into from
Oct 2, 2019

Conversation

connorjclark
Copy link
Collaborator

For example usages, see #9712 and #9713

.array('urls')
.string('lh-flags')
.default('lh-flags', '')
// Why is the printing for examples so awful?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Anyone know how to make yargs examples output not look terrible?
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

We're still on ancient yargs so I'm sure it's been fixed in a version released in the past 5 years :)

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

awesome script :)

.array('urls')
.string('lh-flags')
.default('lh-flags', '')
// Why is the printing for examples so awful?
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're still on ancient yargs so I'm sure it's been fixed in a version released in the past 5 years :)

lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to staging September 23, 2019 23:38 Inactive
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

this is really handy. Do we want a more descriptive name for the script? I don't have a good suggestion, though

/** @type {LH.Result} */
const lhr = JSON.parse(lhrJson);

for (const measureName of lhr.timing.entries.map(entry => entry.name)) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: it might make sense to s/measure/timing for a lot of these names, to avoid splitting the nomenclature from timing/Execution timings/timingEntries we use for the values in all of the core files. Not a huge deal, but it does make it harder to remember in this file that there are accumulations of lhr.timing entries

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

gave it a shot

lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
lighthouse-core/scripts/timings.js Outdated Show resolved Hide resolved
@connorjclark
Copy link
Collaborator Author

compare-timings.js?

@brendankenny
Copy link
Member

compare-timings.js?

SGTM

lighthouse-core/scripts/compare-timings.js Outdated Show resolved Hide resolved
function summarize() {
// `${url}@@@${entry.name}` -> duration
/** @type {Map<string, number[]>} */
const durationsMap = new Map();
Copy link
Member

Choose a reason for hiding this comment

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

not sure this is better. Now we have timing, measure, and duration :)

lighthouse-core/scripts/compare-timings.js Outdated Show resolved Hide resolved
lighthouse-core/scripts/compare-timings.js Outdated Show resolved Hide resolved
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM! ⏱📊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants