Revision c30fd6f2
Added by Lukas Zapletal almost 6 years ago
app/controllers/home_controller.rb | ||
---|---|---|
|
||
# check for exception - set the result code and duration time
|
||
def exception_watch(&block)
|
||
start = Time.now.utc
|
||
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||
result = {}
|
||
begin
|
||
yield
|
||
result[:result] = 'ok'
|
||
result[:status] = :ok
|
||
result[:version] = SETTINGS[:version].full
|
||
result[:db_duration_ms] = ((Time.now.utc - start) * 1000).round.to_s
|
||
result[:db_duration_ms] = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - start) * 1000).round.to_s
|
||
rescue => e
|
||
result[:result] = 'fail'
|
||
result[:status] = :internal_server_error
|
Also available in: Unified diff
Fixes #23808 - monotonic timer to measure durations