module Kasket::Events

Interface to the internal instrumentation event.

Public Class Methods

report(event, ar_klass) click to toggle source

Invokes the configured events callback, if provided.

The callback behaves like a listener, and receives the same arguments that are passed to this ‘report` method.

@param [String] event the type of event being instrumented. @param [class] ar_klass the ActiveRecord::Base subclass that the event

refers to.

@return [nil]

# File lib/kasket/events.rb, line 18
def report(event, ar_klass)
  return unless fn

  fn.call(event, ar_klass)
  nil
end

Private Class Methods

fn() click to toggle source
# File lib/kasket/events.rb, line 27
def fn
  return @fn if defined?(@fn)

  @fn = Kasket::CONFIGURATION[:events_callback]
end