Class: RubyProf::AggregateCallInfo
- Inherits:
-
Object
- Object
- RubyProf::AggregateCallInfo
- Defined in:
- lib/ruby-prof/aggregate_call_info.rb
Instance Attribute Summary collapse
-
#call_infos ⇒ Object
readonly
Returns the value of attribute call_infos.
-
#method_info ⇒ Object
readonly
Returns the value of attribute method_info.
Instance Method Summary collapse
- #called ⇒ Object
- #children ⇒ Object
- #children_time(i = 0) ⇒ Object
-
#initialize(call_infos, method_info) ⇒ AggregateCallInfo
constructor
A new instance of AggregateCallInfo.
- #line ⇒ Object
- #parent ⇒ Object
- #self_time(i = 0) ⇒ Object
- #target ⇒ Object
- #to_s ⇒ Object
- #total_time(i = 0) ⇒ Object
- #wait_time(i = 0) ⇒ Object
Constructor Details
#initialize(call_infos, method_info) ⇒ AggregateCallInfo
Returns a new instance of AggregateCallInfo.
7 8 9 10 11 12 13 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 7 def initialize(call_infos, method_info) if call_infos.length == 0 raise(ArgumentError, "Must specify at least one call info.") end @call_infos = call_infos @method_info = method_info end |
Instance Attribute Details
#call_infos ⇒ Object (readonly)
Returns the value of attribute call_infos.
5 6 7 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 5 def call_infos @call_infos end |
#method_info ⇒ Object (readonly)
Returns the value of attribute method_info.
5 6 7 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 5 def method_info @method_info end |
Instance Method Details
#called ⇒ Object
49 50 51 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 49 def called aggregate_all(:called) end |
#children ⇒ Object
27 28 29 30 31 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 27 def children call_infos.inject(Array.new) do |result, call_info| result.concat(call_info.children) end end |
#children_time(i = 0) ⇒ Object
45 46 47 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 45 def children_time(i = 0) aggregate_roots(:children_time, i) end |
#line ⇒ Object
23 24 25 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 23 def line call_infos.first.line end |
#parent ⇒ Object
19 20 21 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 19 def parent call_infos.first.parent end |
#self_time(i = 0) ⇒ Object
37 38 39 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 37 def self_time(i = 0) aggregate_roots(:self_time, i) end |
#target ⇒ Object
15 16 17 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 15 def target call_infos.first.target end |
#to_s ⇒ Object
53 54 55 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 53 def to_s "#{call_infos.first.target.full_name}" end |
#total_time(i = 0) ⇒ Object
33 34 35 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 33 def total_time(i = 0) aggregate_roots(:total_time, i) end |
#wait_time(i = 0) ⇒ Object
41 42 43 |
# File 'lib/ruby-prof/aggregate_call_info.rb', line 41 def wait_time(i = 0) aggregate_roots(:wait_time, i) end |