Class: Gruf::Instrumentation::OutputMetadataTimer

Inherits:
Base
  • Object
show all
Defined in:
lib/gruf/instrumentation/output_metadata_timer.rb

Overview

Appends the timer metadata to the active call output metadata

Instance Attribute Summary

Attributes inherited from Base

#options, #service

Instance Method Summary collapse

Methods inherited from Base

#initialize, #method_key, #outer_around, #service_key, #setup, #success?

Methods included from Loggable

#logger

Constructor Details

This class inherits a constructor from Gruf::Instrumentation::Base

Instance Method Details

#call(rc) ⇒ Hash

Handle the instrumented response. Note: this will only instrument timings of successful responses.

Parameters:

Returns:

  • (Hash)

    The resulting output metadata with the timer attached



29
30
31
# File 'lib/gruf/instrumentation/output_metadata_timer.rb', line 29

def call(rc)
  rc.active_call..update( => rc.execution_time.to_s)
end