Class: TestProf::EventProf::ProfilersGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/event_prof/profiler.rb

Overview

Multiple profilers wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event:, **options) ⇒ ProfilersGroup

Returns a new instance of ProfilersGroup.



124
125
126
127
128
129
# File 'lib/test_prof/event_prof/profiler.rb', line 124

def initialize(event:, **options)
  events = event.split(",")
  @profilers = events.map do |ev|
    Profiler.new(event: ev, **options)
  end
end

Instance Attribute Details

#profilersObject (readonly)

Returns the value of attribute profilers.



122
123
124
# File 'lib/test_prof/event_prof/profiler.rb', line 122

def profilers
  @profilers
end

Instance Method Details

#each(&block) ⇒ Object



131
132
133
134
135
136
137
# File 'lib/test_prof/event_prof/profiler.rb', line 131

def each(&block)
  if block
    @profilers.each(&block)
  else
    @profilers.each
  end
end

#eventsObject



139
140
141
# File 'lib/test_prof/event_prof/profiler.rb', line 139

def events
  @profilers.map(&:event)
end