Blame view

utils/pp_convert.rb 691 Bytes
1b1e928cc   glaville   initial import of...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  #!/usr/bin/env ruby
  # encoding: UTF-8
  
  FIELDS = ["pp_grass", "pp_move_preys", "pp_move_preds", "pp_step"]
  
  stats = Hash.new
  
  ARGF.each_line do |line|
      case line
      when /preypredator.PreyPredator2/
          puts "# #{line}"
          puts "# #{FIELDS.join(' ')}"
      when /org.perf4j.TimingLogger/
          tag  = line.scan(/tag\[(\w+)\]/).first[0]
          time = line.scan(/time\[(\d+)\]/).first[0].to_i
          
          next if tag == "axb_transform" || tag =~ /^gridsearch_/
          
          stats[tag] = time
          
          if tag == "pp_step"
              puts stats.values_at(*FIELDS).join(" ")
              stats.clear
          end
          
          #puts "#{tag}: #{time}"
      end
  end