Class: Spore::Middleware::Runtime
Instance Method Summary
collapse
#expected_params, #initialize
Instance Method Details
#process_request(env) ⇒ Object
6
7
8
9
|
# File 'lib/spore/middleware/runtime.rb', line 6
def process_request(env)
env['sporex.runtime.start'] = Time.now
return nil
end
|
#process_response(resp, env) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/spore/middleware/runtime.rb', line 11
def process_response(resp, env)
elapsed_time = Time.now - env['sporex.runtime.start']
resp.['X-Spore-Runtime'] = elapsed_time
return resp
end
|