Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 65f4c5f

Browse files
committed
Round timing
1 parent 6f2806b commit 65f4c5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/cc/service/invocation/with_metrics.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def initialize(invocation, statsd, prefix = nil)
88

99
def call
1010
start_time = Time.now
11-
11+
1212
result = @invocation.call
1313
@statsd.increment(success_key)
1414

@@ -17,14 +17,14 @@ def call
1717
@statsd.increment(error_key(ex))
1818
raise ex
1919
ensure
20-
duration = ((Time.now - start_time) * 1_000)
20+
duration = ((Time.now - start_time) * 1_000).round
2121
@statsd.timing(timing_key, duration)
2222
end
2323

2424
def success_key
2525
["services.invocations", @prefix].compact.join('.')
2626
end
27-
27+
2828
def timing_key
2929
["services.timing", @prefix].compact.join('.')
3030
end

0 commit comments

Comments
 (0)