Sha256: 9be4454f926161be4696e2575be993498a673a818131dd9aecbd6fdda7e12741

Contents?: true

Size: 827 Bytes

Versions: 53

Compression:

Stored size: 827 Bytes

Contents

class JRubyProf
  class ThreadSet
    attr_reader :invocations, :duration
  
    def initialize(invocations, duration)
      @invocations = invocations.map do |inv|
        c = inv
        c = c.parent while c.parent
        c
      end
      @duration = duration
    end
    
    def length
      invocations.length
    end
    
    def top_level_duration
      invocations.inject(0.0) do |m, inv| 
        m + inv.childrens_duration
      end
    end
    
    def self.add_methods(h, inv, duration=nil, count=nil)
      return if inv.name =~ /CachingCallSite\.stop_tracing/ or inv.name =~ /JRubyProf\.stop/
      h[inv.name] ||= Method.new(inv.class_name, inv.method_name, inv.static?)
      h[inv.name].add_invocation(inv)
      inv.children.each do |child_inv|
        add_methods(h, child_inv)
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 5 rubygems

Version Path
redcar-0.3.10.0dev plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.9 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.9.0dev plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.8.4 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.8.3 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.8.2 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.8.1 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.8 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.7.1 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.7 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.6 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.3.5 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
jruby-prof-0.1.0 lib/jruby-prof/invocation_set.rb