Class: Tracebin::Subscribers

Inherits:
Object
  • Object
show all
Defined in:
lib/tracebin/subscribers.rb

Overview

Subscribes to certain events, handels them, and passes event data to the Recorder class. The general workflow goes like this:

  1. Patch the method you want to profile. It should generate an array that

looks like the following:

[
  "event_type.event_domain",
  start_time,
  stop_time,
  etc...,
  { event: :data }
]

Note that the event hash must be the last element in the array (this is to maintain consistency with ActiveSupport::Notifications).

  1. Store that event array into an appropriate Event subclass.

  2. Add each Event object to @events_data using the #<< method.

Instance Method Summary collapse

Constructor Details

#initializeSubscribers

Returns a new instance of Subscribers.



29
30
31
32
# File 'lib/tracebin/subscribers.rb', line 29

def initialize
  @events_data = Recorder
  collect_events_data
end