Is it possible to ignore irrelevant methods when profiling ruby applications?

后端 未结 2 1386
眼角桃花
眼角桃花 2021-01-22 19:24

While using ruby-prof, printed out in graph-html mode, the report for one method says (with some snipping)

%Total       %Self       Total       Self    Wait    C         


        
2条回答
  •  情歌与酒
    2021-01-22 19:54

    Version 0.9.0 of ruby-prof allows method elimination. For example, to eliminate Integer#times, use

    result = RubyProf.stop
    result.eliminate_methods!([/Integer#times/])
    

    so that

    def method_a
      5.times {method_b}
    end
    

    will indicate the relationship between method_a and method_b directly.

提交回复
热议问题