Sha256: 68fd10cfff3d347cd123c110c49ab567aaa7e4b25c2ff93c33d3bffa44bc5f40
Contents?: true
Size: 862 Bytes
Versions: 1
Compression:
Stored size: 862 Bytes
Contents
#!/usr/bin/env ruby require 'json' if ARGV.count<1 puts "Usage: #{$0} [-t] [-j] stats1.json" exit -1 end # print header if ARGV[0]=='-t' heads=['Plugin name','execution_time (s)'] puts heads.join("\t") ARGV.shift end puts_json=false if ARGV[0]=='-j' puts_json=true ARGV.shift end ARGV.each do |file_path| sample_name = File.basename(File.expand_path(File.join(file_path,'..','..'))) stats=JSON::parse(File.read(file_path)) res={} begin stats.keys.each do |k| if stats[k]['execution_time'] res[k]=stats[k]['execution_time']['total_seconds'] end end rescue Excepcion => e puts "Error reading #{file_path}" end if puts_json puts JSON::pretty_generate(res) else total=0 res.keys.sort.each do |k| puts "#{k}\t#{res[k]}" total+=res[k] end puts "-"*20 puts "TOTAL (plugins):\t#{total}" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
seqtrimnext-2.0.61 | bin/resume_execution_times.rb |