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.



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

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.



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

def profilers
  @profilers
end

Instance Method Details

#eachObject



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

def each
  if block_given?
    @profilers.each(&Proc.new)
  else
    @profilers.each
  end
end

#eventsObject



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

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