Class: Gruf::Interceptors::Instrumentation::OutputMetadataTimer
- Inherits:
-
ServerInterceptor
- Object
- Base
- ServerInterceptor
- Gruf::Interceptors::Instrumentation::OutputMetadataTimer
- Defined in:
- lib/gruf/interceptors/instrumentation/output_metadata_timer.rb
Overview
Appends the timer metadata to the active call output metadata
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#call ⇒ Object
Handle the instrumented response.
Methods included from Errors::Helpers
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gruf::Interceptors::Base
Instance Method Details
#call ⇒ Object
Handle the instrumented response. Note: this will only instrument timings of successful responses.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/gruf/interceptors/instrumentation/output_metadata_timer.rb', line 28 def call return unless active_call.respond_to?(:output_metadata) result = Gruf::Interceptors::Timer.time do yield end .update( => result.elapsed.to_s) raise result. unless result.successful? result. end |