rails--rails/actionpack/test
Sebastian Sogamoso 0547b1646d
Add Server Timing middleware (#36289)
* Add Server Timing middleware

What is server timing?
It's a specification that defines how the server can communicate the
user-agent performance metrics about the request it is responding to.

Here's the official specification:
https://www.w3.org/TR/server-timing/#dfn-server-timing-header-field

How does it work?
This introduces a new `ServerTiming` middleware only on `development` by
default, this is done using the `config.server_timing` setting.

It works by subscribing to all `ActiveSupport::Notifications` and adding
their duration to the `Server-Timing` header.

Why is this useful?
It makes looking at performance metrics in development much easier,
especially when using Chrome dev tools which includes the metrics in the
Network Inspector. Here's an example:

![](https://d3vv6lp55qjaqc.cloudfront.net/items/371h2y3B3a0U470j040u/Image%202019-05-15%20at%205.40.37%20PM.png?)

Paired on this with @guilleiguaran
2021-09-19 21:27:07 -07:00
..
abstract Fix generated MIME methods to recognize kwargs 2021-08-07 13:59:08 +09:00
assertions Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
controller Don't show deprecation warning for equal paths 2021-09-08 11:45:19 +02:00
dispatch Add Server Timing middleware (#36289) 2021-09-19 21:27:07 -07:00
fixtures Allow rails to serve brotli encoded assets 2020-06-01 08:57:02 -07:00
journey Restore the behavior of journey root node methods 2021-08-12 09:51:38 -04:00
lib Include layout when rendering objects from controllers 2020-10-14 11:49:45 -06:00
routing Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
support Introduce Journey::Ast to avoid extra ast walks 2021-07-29 16:23:11 -04:00
abstract_unit.rb Let the Action Pack autoload with Zeitwerk 2021-08-21 20:20:23 +02:00