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) ⇒ AggregateCallInfo

Returns a new instance of AggregateCallInfo.



4
5
6
7
8
9
# File 'lib/ruby-prof/aggregate_call_info.rb', line 4

def initialize(call_infos)
  if call_infos.length == 0
    raise(ArgumentError, "Must specify at least one call info.")
  end
  @call_infos = call_infos
end

Instance Attribute Details

#call_infosObject (readonly)

Returns the value of attribute call_infos.



3
4
5
# File 'lib/ruby-prof/aggregate_call_info.rb', line 3

def call_infos
  @call_infos
end

Instance Method Details

#calledObject



45
46
47
# File 'lib/ruby-prof/aggregate_call_info.rb', line 45

def called
  aggregate(:called)
end

#childrenObject



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

def children
  call_infos.inject(Array.new) do |result, call_info|
    result.concat(call_info.children)
  end
end

#children_timeObject



41
42
43
# File 'lib/ruby-prof/aggregate_call_info.rb', line 41

def children_time
  aggregate_minimal(:children_time)
end

#lineObject



19
20
21
# File 'lib/ruby-prof/aggregate_call_info.rb', line 19

def line
  call_infos.first.line
end

#parentObject



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

def parent
  call_infos.first.parent
end

#self_timeObject



33
34
35
# File 'lib/ruby-prof/aggregate_call_info.rb', line 33

def self_time
  aggregate(:self_time)
end

#targetObject



11
12
13
# File 'lib/ruby-prof/aggregate_call_info.rb', line 11

def target
  call_infos.first.target
end

#to_sObject



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

def to_s
  "#{call_infos.first.full_name}"
end

#total_timeObject



29
30
31
# File 'lib/ruby-prof/aggregate_call_info.rb', line 29

def total_time
  aggregate_minimal(:total_time)
end

#wait_timeObject



37
38
39
# File 'lib/ruby-prof/aggregate_call_info.rb', line 37

def wait_time
  aggregate(:wait_time)
end