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: move transfer ratio estimate to script-helpers.js #15665

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Dec 6, 2023

following up to #15640, just moving duplicated things to a common place, and out of an Audit class.

@connorjclark connorjclark requested a review from a team as a code owner December 6, 2023 22:09
@connorjclark connorjclark requested review from adamraine and removed request for a team December 6, 2023 22:09
* @param {LH.Crdp.Network.ResourceType=} resourceType
* @return {number}
*/
function estimateTransferSize(networkRecord, totalBytes, resourceType) {
Copy link
Member

Choose a reason for hiding this comment

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

Moving these helpers elsewhere seems reasonable but script-helpers.js doesn't seem like the right place. These functions can operate on any arbitrary network request not just scripts.

Maybe a better location would be static functions on NetworkRequest? There are already some functions like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about a computed artifact?

Can we land this for now, I've already got a PR on top.

Copy link
Member

Choose a reason for hiding this comment

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

Sure

@connorjclark connorjclark merged commit 14428d7 into main Dec 6, 2023
28 of 29 checks passed
@connorjclark connorjclark deleted the move-transfers branch December 6, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants