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

Updated ActiveSupport instrumentation guide to include Server Timings… #48221

Merged
merged 1 commit into from May 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions guides/source/active_support_instrumentation.md
Expand Up @@ -11,6 +11,7 @@ After reading this guide, you will know:

* What instrumentation can provide.
* How to add a subscriber to a hook.
* How to view timings from instrumentation in your browser.
* The hooks inside the Rails framework for instrumentation.
* How to build a custom instrumentation implementation.

Expand Down Expand Up @@ -95,6 +96,18 @@ end
[`ActiveSupport::Notifications.monotonic_subscribe`]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html#method-c-monotonic_subscribe
[`ActiveSupport::Notifications.subscribe`]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html#method-c-subscribe

View timings from instrumentation in your browser
-----------------------

Rails implements the [Server Timing](https://www.w3.org/TR/server-timing/) standard to make timing information available in the web browser. To enable, edit your environment configuration (usually `development.rb` as this is most-used in development) to include the following:


```ruby
config.server_timing = true
```

Once configured (including restarting your server), you can go to the Developer Tools pane of your browser, then select Network and reload your page. You can then select any request to your Rails server, and will see server timings in the timings tab. For an example of doing this, see the [Firefox Documentation](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/request_details/index.html#server-timing).

Rails Framework Hooks
---------------------

Expand Down