Class: Corn::Profiler
- Inherits:
-
Object
- Object
- Corn::Profiler
- Defined in:
- lib/corn/profiler.rb
Instance Method Summary collapse
-
#initialize(post_interval, sampling_interval) ⇒ Profiler
constructor
A new instance of Profiler.
- #profile(handler, &block) ⇒ Object
- #terminate ⇒ Object
Constructor Details
Instance Method Details
#profile(handler, &block) ⇒ Object
12 13 14 |
# File 'lib/corn/profiler.rb', line 12 def profile(handler, &block) @prof.profile(lambda {|data| @post.enqueue(handler.call(data))}, &block) end |
#terminate ⇒ Object
16 17 18 19 |
# File 'lib/corn/profiler.rb', line 16 def terminate @prof.terminate rescue nil @post.terminate rescue nil end |