Skip to content

Commit 4c2fdbf

Browse files
Move Server Timing info to Configuration guide [ci-skip]
Follow-up to rails#48221. The Active Support Instrumentation guide is about the `ActiveSupport::Notifications` API. Therefore, move the information about `config.server_timing` and the `ActionDispatch::ServerTiming` middleware to the existing sections in the Configuration guide.
1 parent 4726b1a commit 4c2fdbf

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

guides/source/active_support_instrumentation.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ After reading this guide, you will know:
1111

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

@@ -85,17 +84,6 @@ end
8584
[`ActiveSupport::Notifications.monotonic_subscribe`]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html#method-c-monotonic_subscribe
8685
[`ActiveSupport::Notifications.subscribe`]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html#method-c-subscribe
8786

88-
View Timings from Instrumentation in Your Browser
89-
-------------------------------------------------
90-
91-
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:
92-
93-
```ruby
94-
config.server_timing = true
95-
```
96-
97-
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).
98-
9987
Rails Framework Hooks
10088
---------------------
10189

guides/source/configuring.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,9 @@ for more information and alternative configuration methods.
547547

548548
#### `config.server_timing`
549549

550-
When `true`, adds the [ServerTiming middleware](#actiondispatch-servertiming)
551-
to the middleware stack
550+
When `true`, adds the [`ServerTiming` middleware](#actiondispatch-servertiming)
551+
to the middleware stack. Defaults to `false`, but is set to `true` in the
552+
default generated `config/environments/development.rb` file.
552553

553554
#### `config.session_options`
554555

@@ -768,8 +769,12 @@ Rails.application.config.host_authorization = {
768769

769770
#### `ActionDispatch::ServerTiming`
770771

771-
Adds metrics to the `Server-Timing` header to be viewed in the dev tools of a
772-
browser.
772+
Adds the [`Server-Timing`][] header to the response, which includes performance
773+
metrics from the server. This data can be viewed by inspecting the response in
774+
the Network panel of the browser's Developer Tools. Most browsers provide a
775+
Timing tab that visualizes the data.
776+
777+
[`Server-Timing`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
773778

774779
#### `ActionDispatch::SSL`
775780

0 commit comments

Comments
 (0)