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

core(lhr): include resourceSize in network-requests audit #7056

Merged
merged 1 commit into from
Jan 29, 2019

Conversation

paulirish
Copy link
Member

along with the idea of #7052.... i noticed resource size isn't exposed in the lhr anywhere. seems reasonable to tack on here. wdyt?

{
key: 'resourceSize',
itemType: 'bytes',
displayUnit: 'kb',
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't this bytes?

image

Copy link
Collaborator

@patrickhulce patrickhulce Jan 18, 2019

Choose a reason for hiding this comment

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

yeah it is, i18n lib converts it I believe

// Replace all the bytes with KB
parsed.elements
.filter(el => el.format && el.format.style === 'bytes')
// @ts-ignore - el.id is always defined when el.format is defined
.forEach(el => (clonedValues[el.id] = clonedValues[el.id] / 1024));

Copy link
Member

Choose a reason for hiding this comment

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

yeah, it's interpreted by the itemType but is put into the LHR as the displayUnit

Copy link
Member

Choose a reason for hiding this comment

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

but is put into the LHR as the displayUnit

er, that's not right. It is if it's in an i18ned string, otherwise it's not until details-renderer.js that the displayUnit is used...which is pointless here because these aren't displayed in the html report

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

{
key: 'resourceSize',
itemType: 'bytes',
displayUnit: 'kb',
Copy link
Member

Choose a reason for hiding this comment

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

yeah, it's interpreted by the itemType but is put into the LHR as the displayUnit

@@ -870,6 +880,7 @@
"startTime": 636.6400000115391,
"endTime": 1213.2910000218544,
"transferSize": 139,
"resourceSize": 0,
Copy link
Member

Choose a reason for hiding this comment

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

why do these 0 resourceSize items have transferSize set?

Copy link
Member

Choose a reason for hiding this comment

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

why do these 0 resourceSize items have transferSize set?

and this makes a lot more sense now when 139 isn't the transferSize in KB, it's in bytes :)

@brendankenny brendankenny merged commit 6b0494b into master Jan 29, 2019
@brendankenny brendankenny deleted the resourcesize branch January 29, 2019 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants