Module: TwitterFriendly::CachingAndLogging::Instrumenter

Defined in:
lib/twitter_friendly/caching_and_logging.rb

Class Method Summary collapse

Class Method Details

.complete_processing(method_name, options) ⇒ Object



47
48
49
50
# File 'lib/twitter_friendly/caching_and_logging.rb', line 47

def complete_processing(method_name, options)
  payload = {operation: method_name}.merge(options)
  ::ActiveSupport::Notifications.instrument('complete_processing.twitter_friendly', payload) { yield(payload) }
end

.perform_request(method_name, options, &block) ⇒ Object



52
53
54
55
# File 'lib/twitter_friendly/caching_and_logging.rb', line 52

def perform_request(method_name, options, &block)
  payload = {operation: 'request', args: [method_name, options]}
  ::ActiveSupport::Notifications.instrument('request.twitter_friendly', payload) { yield(payload) }
end

.start_processing(method_name, options) ⇒ Object



42
43
44
45
# File 'lib/twitter_friendly/caching_and_logging.rb', line 42

def start_processing(method_name, options)
  payload = {operation: method_name}.merge(options)
  ::ActiveSupport::Notifications.instrument('start_processing.twitter_friendly', payload) {}
end