jhawthorn / vernier

πŸ“ next generation CRuby profiler
https://vernier.prof/
MIT License
806 stars 17 forks source link

Vernier.trace_retained: fails on missing keywords #28

Closed yosiat closed 10 months ago

yosiat commented 1 year ago

Hi!

First of all, thanks for developing this amazing tool πŸš€ I am trying to use it, I managed to get Vernier.trace example to work, but the trace_retained isn't working for me:

 ❯ ruby -r vernier -e 'Vernier.trace_retained(out: "irb_profile.json") { require "irb" }'
/Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:160:in `initialize': missing keywords: :name, :timestamps, :sample_categories, :started_at (ArgumentError)
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:104:in `new'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:104:in `block in data'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:102:in `each'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:102:in `map'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:102:in `data'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/output/firefox.rb:92:in `output'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/result.rb:24:in `to_gecko'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier/result.rb:28:in `write'
        from /Users/yosi/.rvm/gems/ruby-3.2.2/gems/vernier-0.3.0/lib/vernier.rb:44:in `trace_retained'
        from -e:1:in `<main>'

~
 ❯ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
jhawthorn commented 1 year ago

Sorry! I broke this half-intentionally in the latest version. I've been focusing a bit more on time profiles rather than memory profiles, but I hope to fix this back up soon.

jhawthorn commented 10 months ago

This is fixed in the latest release (there's some issues with how it's displayed in "stack chart" mode but everything else should work πŸ˜…)