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-dev-0.12.16dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.15dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.14dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.13dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.12dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.11dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.10dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.9dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.8dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.7dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.6dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.4dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.3dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.1dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-dev-0.12.0dev-java plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.11 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.11.0dev plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.10 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
redcar-0.9.2 plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb
rdp-jruby-prof-0.1.0.1 lib/jruby-prof/invocation_set.rb