Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added server timing to REST API response#1206

Merged
westonruter merged 13 commits into
WordPress:trunkWordPress/performance:trunkfrom
ashwinparthasarathi:update/add-server-timing-in-rest-apiashwinparthasarathi/performance:update/add-server-timing-in-rest-apiCopy head branch name to clipboard
May 14, 2024
Merged

Added server timing to REST API response#1206
westonruter merged 13 commits into
WordPress:trunkWordPress/performance:trunkfrom
ashwinparthasarathi:update/add-server-timing-in-rest-apiashwinparthasarathi/performance:update/add-server-timing-in-rest-apiCopy head branch name to clipboard

Conversation

@ashwinparthasarathi

@ashwinparthasarathi ashwinparthasarathi commented May 7, 2024

Copy link
Copy Markdown
Contributor

Summary

Fixes #1149

Relevant technical choices

Updated the core plugin to add ServerTiming to WP REST API end-points as well

How to test

  1. On the site, visit the REST endpoint http://localhost:8888/wp-json/ with the Dev Tools open on the Network Tab
  2. Record the data in the Timing tab as seen here before and after the change.
  3. The difference is documented as follows,
  • Before the change is introduced,
    before-change-rest-api

  • After the change,
    after-change-rest-api

props: @swissspidy for the code.

@ashwinparthasarathi
ashwinparthasarathi marked this pull request as ready for review May 7, 2024 18:29
@github-actions

github-actions Bot commented May 7, 2024

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ashwinparthasarathi <ashwinparthasarathi@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: joemcgill <joemcgill@git.wordpress.org>
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
ashwinparthasarathi and others added 5 commits May 8, 2024 01:35
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
…winparthasarathi/performance into update/add-server-timing-in-rest-api
Co-authored-by: Weston Ruter <westonruter@google.com>
@mukeshpanchal27 mukeshpanchal27 added [Type] Enhancement A suggestion for improvement of an existing feature [Focus] Server Response Time [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only no milestone PRs that do not have a defined milestone for release labels May 8, 2024
Comment thread includes/server-timing/hooks.php
Comment thread includes/server-timing/hooks.php
ashwinparthasarathi and others added 2 commits May 8, 2024 11:42
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost there.

Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated

@joemcgill joemcgill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I've left a lot of feedback, but the only real blocking issue I see is the function name being introduced.

Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated
Comment thread includes/server-timing/hooks.php Outdated

@ashwinparthasarathi ashwinparthasarathi left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed code based on review comments.

Comment thread includes/server-timing/hooks.php Outdated
Updated header value for Server-Timing

Co-authored-by: Weston Ruter <westonruter@google.com>

@adamsilverstein adamsilverstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work!

@westonruter westonruter added this to the performance-lab 3.1.0 milestone May 14, 2024
@westonruter
westonruter merged commit 27d81f3 into WordPress:trunk May 14, 2024
@ashwinparthasarathi
ashwinparthasarathi deleted the update/add-server-timing-in-rest-api branch May 15, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no milestone PRs that do not have a defined milestone for release [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server-Timing: Add in REST API

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.