Module: Roda::RodaPlugins::ServerTiming::InstanceMethods
- Defined in:
- lib/roda/plugins/server_timing.rb
Instance Method Summary collapse
-
#benchmark(name:, description: nil) ⇒ Object
Benchmark the provided block and return it’s result.
-
#server_timing ⇒ Object
Shorthand to the
RackServerTiming::Recorderinstance.
Instance Method Details
#benchmark(name:, description: nil) ⇒ Object
Benchmark the provided block and return it’s result
15 16 17 18 19 20 21 22 23 |
# File 'lib/roda/plugins/server_timing.rb', line 15 def benchmark(name:, description: nil) result = nil server_timing.benchmark(name: name, description: description) do result = yield end result end |
#server_timing ⇒ Object
Shorthand to the RackServerTiming::Recorder instance
10 11 12 |
# File 'lib/roda/plugins/server_timing.rb', line 10 def server_timing env["rack.server_timing"] end |