summaryrefslogtreecommitdiff
path: root/ext/probeprofiler/lib/probeprofiler.rb
blob: a00b6df653cb19369a1ce6abc8a9d868ea336309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

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