jeremy/ruby-prof — Issue #7: abstract_printer failure
Author: mksenzov
Created: 2011-10-18 15:35:57+00:00
State: open

when I run code like this:

require 'lsys/snowflake'
require 'ruby-prof'

g = Snowflake.new

RubyProf.start
g.run(1)
result = RubyProf.stop

printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT, 0)

I get:

Thread ID: 70181321871060
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/abstract_printer.rb:26:in `[]': can't convert Symbol into Integer (TypeError)
Total: 0.003480

%self total self wait child calls name
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/abstract_printer.rb:26:in `min_percent'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:59:in `block in print_methods'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:57:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:57:in `print_methods'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:32:in `block in print_threads'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:31:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:31:in `print_threads'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/ruby-prof-0.10.8/lib/ruby-prof/flat_printer.rb:25:in `print'
from /Users/sh/Developer/32pins/UrbanScape/examples/lsys/temp.rb:11:in `'
from -e:1:in `load'
from -e:1:in `

'

my gems:

oyster:UrbanScape sh$ gem list

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
citrus (2.4.0)
columnize (0.3.4)
daemons (1.1.4)
eventmachine (0.12.10)
linecache19 (0.5.12)
rack (1.3.5, 1.3.4)
rake (0.9.2)
ruby-debug-base19 (0.11.25)
ruby-debug-base19x (0.11.29)
ruby-debug-ide (0.4.16)
ruby-prof (0.10.8)
ruby_core_source (0.1.5)
thin (1.2.11)