Class: TestProf::EventProf::Instrumentations::ActiveSupport::Subscriber
- Inherits:
-
Object
- Object
- TestProf::EventProf::Instrumentations::ActiveSupport::Subscriber
- Defined in:
- lib/test_prof/event_prof/instrumentations/active_support.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(block) ⇒ Subscriber
constructor
A new instance of Subscriber.
- #publish(_name, started_at, finished_at) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(block) ⇒ Subscriber
Returns a new instance of Subscriber.
10 11 12 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 10 def initialize(block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
8 9 10 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 8 def block @block end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
8 9 10 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 8 def started_at @started_at end |
Instance Method Details
#finish ⇒ Object
22 23 24 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 22 def finish(*) block.call(TestProf.now - started_at) end |
#publish(_name, started_at, finished_at) ⇒ Object
18 19 20 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 18 def publish(_name, started_at, finished_at, *) block.call(finished_at - started_at) end |