Class: RubyProf::AggregateCallInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-prof/aggregate_call_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_infosObject (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_infoObject (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

#calledObject



49
50
51
# File 'lib/ruby-prof/aggregate_call_info.rb', line 49

def called
  aggregate_all(:called)
end

#childrenObject



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

#lineObject



23
24
25
# File 'lib/ruby-prof/aggregate_call_info.rb', line 23

def line
  call_infos.first.line
end

#parentObject



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

#targetObject



15
16
17
# File 'lib/ruby-prof/aggregate_call_info.rb', line 15

def target
  call_infos.first.target
end

#to_sObject



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