14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/dontbugme/subscribers/redis.rb', line 14
def call(command, &block)
return super unless Dontbugme::Context.active?
return super unless Dontbugme.config.recording?
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
start_wall = Time.now
result = super
duration_ms = (Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) - start_time).round(2)
record_span(command, start_wall, duration_ms, result: result)
result
rescue StandardError => e
duration_ms = (Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) - start_time).round(2)
record_span(command, start_wall, duration_ms, error: e)
raise
end
|