Class: Thrift::Metrics::Middleware::Timing
- Inherits:
-
Object
- Object
- Thrift::Metrics::Middleware::Timing
- Defined in:
- lib/thrift/metrics.rb
Class Method Summary collapse
Class Method Details
.instrument(name, &block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/thrift/metrics.rb', line 20 def instrument(name, &block) t0 = Time.now begin r = block.call send_duration name, t0 r rescue => e send_duration name, t0 raise e end end |