1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/probeprofiler/lib/probeprofiler.rb
nobu 5bda3debcf * ext/probeprofiler: set eol-style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 04:10:55 +00:00

14 lines
379 B
Ruby

require 'probeprofiler.so'
def ProbeProfiler.print_profile
data = ProbeProfiler.profile_data
total = 0.0
printf("%-60s %-8s %-7s\n", "ProbeProfile Result: Method signature", "count", "ratio")
data.map{|k, n| total += n; [n, k]}.sort.reverse.each{|n, sig|
#
printf("%-60s %8d %7.2f%%\n", sig, n, 100 * n / total)
}
printf("%60s %8d\n", "total:", total)
end