Sha256: 11d8c659a9bca8bd0f6f3d96f8063b5d879b44a1a104454a481df5d6ba9b554d

Contents?: true

Size: 498 Bytes

Versions: 5

Compression:

Stored size: 498 Bytes

Contents

module RubyProf
  class Thread
    def top_methods
      self.methods.select do |method_info|
        method_info.call_infos.detect do |call_info|
          call_info.parent.nil?
        end
      end
    end

    def total_time
      self.top_methods.inject(0) do |sum, method_info|
        method_info.call_infos.each do |call_info|
          if call_info.parent.nil?
            sum += call_info.total_time
          end
        end
        sum
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-prof-0.13.1 lib/ruby-prof/thread.rb
ruby-prof-0.13.0 lib/ruby-prof/thread.rb
ruby-prof-0.12.2 lib/ruby-prof/thread.rb
ruby-prof-0.12.1-x86-mingw32 lib/ruby-prof/thread.rb
ruby-prof-0.12.1 lib/ruby-prof/thread.rb