58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'actionpack/lib/action_dispatch/middleware/server_timing.rb', line 58
def call(env)
response = nil
events = @subscriber.collect_events do
response = @app.call(env)
end
= response[1]
= events.group_by(&:name).map do |event_name, events_collection|
"%s;dur=%.2f" % [event_name, events_collection.sum(&:duration)]
end
if [ActionDispatch::Constants::SERVER_TIMING].present?
.prepend([ActionDispatch::Constants::SERVER_TIMING])
end
[ActionDispatch::Constants::SERVER_TIMING] = .join(", ")
response
end
|