Class: Tracebin::Subscribers
- Inherits:
-
Object
- Object
- Tracebin::Subscribers
- 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:
-
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).
-
Store that event array into an appropriate
Event
subclass. -
Add each
Event
object to @events_data using the #<< method.
Instance Method Summary collapse
-
#initialize ⇒ Subscribers
constructor
A new instance of Subscribers.
Constructor Details
#initialize ⇒ Subscribers
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 |