Remove trash
This commit is contained in:
parent
87e9a26396
commit
0491cdb219
23
1.rb
23
1.rb
|
@ -1,23 +0,0 @@
|
|||
require 'json'
|
||||
class Analyzer
|
||||
def initialize(filename)
|
||||
@filename = filename
|
||||
end
|
||||
|
||||
def analyze
|
||||
data = []
|
||||
File.open(@filename) do |f|
|
||||
f.each_line do |line|
|
||||
data << (parsed=JSON.parse(line))
|
||||
end
|
||||
end
|
||||
|
||||
data.group_by{|row| row["generation"]}
|
||||
.sort{|a,b| a[0].to_i <=> b[0].to_i}
|
||||
.each do |k,v|
|
||||
puts "generation #{k} objects #{v.count}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Analyzer.new(ARGV[0]).analyze
|
23
2.rb
23
2.rb
|
@ -1,23 +0,0 @@
|
|||
require 'json'
|
||||
class Analyzer
|
||||
def initialize(filename)
|
||||
@filename = filename
|
||||
end
|
||||
|
||||
def analyze
|
||||
data = []
|
||||
File.open(@filename) do |f|
|
||||
f.each_line do |line|
|
||||
parsed=JSON.parse(line)
|
||||
data << parsed if parsed["generation"]
|
||||
end
|
||||
end
|
||||
data.group_by{|row| "#{row["file"]}:#{row["line"]}"}
|
||||
.sort{|a,b| b[1].count <=> a[1].count}
|
||||
.each do |k,v|
|
||||
puts "#{k} * #{v.count}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Analyzer.new(ARGV[0]).analyze
|
Loading…
Reference in New Issue