Skip to content

Refactor: Improve maintainability of WebpageImpact plugin #159

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexzurbonsen
Copy link
Collaborator

This commit introduces several changes to enhance the maintainability, robustness, and clarity of the WebpageImpact plugin:

  • README: I corrected the description of the duration output metric to accurately reflect its behavior (measures execution time).
  • Constants: I replaced magic numbers related to default viewport dimensions and scroll behavior parameters with named constants for better readability and easier modification.
  • Logging: I enhanced logging in mergeCdpData by consolidating warnings for resources missing transfer sizes into a single message, reducing log noise.
  • Robustness: I added a timeout mechanism to the scrollToBottomOfPage function to prevent indefinite execution on very long or slow-loading pages, logging a warning if the timeout is reached.

This commit introduces several changes to enhance the maintainability,
robustness, and clarity of the WebpageImpact plugin:

- README: I corrected the description of the `duration` output metric to accurately reflect its behavior (measures execution time).
- Constants: I replaced magic numbers related to default viewport dimensions and scroll behavior parameters with named constants for better readability and easier modification.
- Logging: I enhanced logging in `mergeCdpData` by consolidating warnings for resources missing transfer sizes into a single message, reducing log noise.
- Robustness: I added a timeout mechanism to the `scrollToBottomOfPage` function to prevent indefinite execution on very long or slow-loading pages, logging a warning if the timeout is reached.
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.

1 participant