Sha256: 188aaf3ff92f3f4cf477ab7b45da1da9512e013776ea1d1bccb3fa7e319beddc

Contents?: true

Size: 476 Bytes

Versions: 12

Compression:

Stored size: 476 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

12 entries across 10 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/ruby-prof-0.15.1/lib/ruby-prof/thread.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/ruby-prof-0.15.1/lib/ruby-prof/thread.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/ruby-prof-0.15.1/lib/ruby-prof/thread.rb
ruby-prof-0.15.5 lib/ruby-prof/thread.rb
ruby-prof-0.15.4 lib/ruby-prof/thread.rb
ruby-prof-0.15.3 lib/ruby-prof/thread.rb
ruby-prof-0.15.2 lib/ruby-prof/thread.rb
ruby-prof-0.15.1 lib/ruby-prof/thread.rb
ruby-prof-0.15.0 lib/ruby-prof/thread.rb
ruby-prof-0.14.2 lib/ruby-prof/thread.rb
ruby-prof-0.14.1 lib/ruby-prof/thread.rb
ruby-prof-0.14.0 lib/ruby-prof/thread.rb