analyzer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/analyze +1 -1
- data/lib/analyzer.rb +19 -10
- data/lib/analyzer/version.rb +1 -1
- data/lib/templates/gnuplot.sh.erb +10 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e259fae5d2c7856aa73eb2dc95d00b8502cfbd8f
|
4
|
+
data.tar.gz: f0181107ebad07e8eaffa3ff91a8ccd1aab81ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddc63be7d1aece7cadda916383358c18b4736b8583c0fe9d61fc905850a0a0abdcc2c8ec2c56130c5da8e45864357df9f5fcff61e4e29dc6b647cf2d1caaf031
|
7
|
+
data.tar.gz: fec1115edac0d704df03549205f15bd6d16f0f4239652b9774150b234d2adb5b2410852102d770b1894361f18985d5b7d7be326646e9b2bd44426ae9c04454a7
|
data/bin/analyze
CHANGED
@@ -14,7 +14,7 @@ OptionParser.new do |opts|
|
|
14
14
|
options[:lib] = v
|
15
15
|
end
|
16
16
|
|
17
|
-
opts.on("-n x,y,z", Array, "
|
17
|
+
opts.on("-n x,y,z", Array, "A paramater N that will be defined in the test. Each test will run once for each N") do |list|
|
18
18
|
options[:n] = list.map(&:to_i)
|
19
19
|
end
|
20
20
|
|
data/lib/analyzer.rb
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
require 'erb'
|
2
2
|
require 'json'
|
3
3
|
require 'tmpdir'
|
4
|
+
require 'fileutils'
|
4
5
|
|
5
6
|
class Analyzer
|
6
7
|
|
7
8
|
def initialize(*test_files, bootstrap: nil, lib: nil, n: nil)
|
8
9
|
@bootstrap = bootstrap
|
9
10
|
@lib = lib
|
10
|
-
@n = n
|
11
|
+
@n = n || [1]
|
11
12
|
@test_files = test_files
|
13
|
+
|
14
|
+
@keys = test_files.map { |fn| File.basename(fn, '.*') }
|
15
|
+
depth = -1
|
16
|
+
while @keys.uniq.length < @keys.length
|
17
|
+
@keys = test_files.map { |fn| ( File.dirname(fn).split(File::SEPARATOR)[depth..-1] + [File.basename(fn, '.*')] ).join(File::SEPARATOR) }
|
18
|
+
depth -= 1
|
19
|
+
end
|
12
20
|
end
|
13
21
|
|
14
22
|
def key(value)
|
15
|
-
|
23
|
+
@keys[@test_files.index(value)]
|
16
24
|
end
|
17
25
|
|
18
26
|
def tests
|
@@ -29,23 +37,24 @@ class Analyzer
|
|
29
37
|
end
|
30
38
|
|
31
39
|
def write_results_for(type, dir)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
40
|
+
@n.each do |n|
|
41
|
+
FileUtils.mkdir_p(File.join(dir, type, n.to_s))
|
42
|
+
@test_files.each do |src|
|
43
|
+
File.open(File.join(dir, type, n.to_s, key(src)), 'w') do |file|
|
44
|
+
send(:"output_#{type}_results", calculate_results_for(type, File.read(src), n), file)
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|
38
48
|
end
|
39
49
|
|
40
|
-
def calculate_results_for(type, src)
|
50
|
+
def calculate_results_for(type, src, n=1)
|
41
51
|
lib = @lib ? File.read(File.expand_path(@lib)) : ''
|
52
|
+
setup = "N=#{n}\n"
|
42
53
|
|
43
54
|
if src.index("\n__SETUP__\n")
|
44
55
|
src = src.split("\n__SETUP__\n")
|
45
|
-
setup
|
56
|
+
setup << src[0]
|
46
57
|
src = src[1]
|
47
|
-
else
|
48
|
-
setup = ''
|
49
58
|
end
|
50
59
|
|
51
60
|
analyzer_dir = File.expand_path("../", __FILE__)
|
data/lib/analyzer/version.rb
CHANGED
@@ -40,7 +40,8 @@ set style boxplot range 2 nooutliers candlesticks
|
|
40
40
|
set style fill solid 0.2
|
41
41
|
set xtics (<%= tests.map.with_index { |f, i| "'#{escape(f)}' #{i+1}"}.join(', ') %>) scale 0,0
|
42
42
|
|
43
|
-
plot
|
43
|
+
plot \
|
44
|
+
<% @n.each_with_index do |n, ni| %><% tests.each_with_index do |t, i| %>'<%= File.join(data_dir, 'ips', n.to_s, t) %>' using (<%= i+1 %>.0):1 title '<%= escape(t) + (@n.size == 1 ? '' : " #{n}" ) %>' with boxplot linestyle <%= i +1 %> dt <%= ni+1 %><%= tests.size == i+1 && @n.last == n ? '' : ", \\\n" %><% end %><% end %>
|
44
45
|
|
45
46
|
|
46
47
|
set title "GC Objects Allocated"
|
@@ -49,22 +50,24 @@ set yrange [0:*]
|
|
49
50
|
set xrange [0:5]
|
50
51
|
set xtics autofreq
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
plot \
|
54
|
+
<% @n.each_with_index do |n, ni| %><% tests.each_with_index do |t, i| %>'<%= File.join(data_dir, 'gc', n.to_s, t) %>' using 2:5 title '<%= escape(t) + (@n.size == 1 ? '' : " #{n}" ) %>' with steps linestyle <%= i +1 %> dt <%= ni+1 %><%= tests.size == i+1 && @n.last == n ? '' : ", \\\n" %><% end %><% end %>
|
54
55
|
|
55
56
|
set title "GC Objects Freed"
|
56
57
|
set key on
|
57
58
|
set yrange [0:*]
|
58
59
|
set xrange [0:5]
|
59
60
|
|
60
|
-
plot
|
61
|
+
plot \
|
62
|
+
<% @n.each_with_index do |n, ni| %><% tests.each_with_index do |t, i| %>'<%= File.join(data_dir, 'gc', n.to_s, t) %>' using 2:6 title '<%= escape(t) + (@n.size == 1 ? '' : " #{n}" ) %>' with steps linestyle <%= i +1 %> dt <%= ni+1 %><%= tests.size == i+1 && @n.last == n ? '' : ", \\\n" %><% end %><% end %>
|
61
63
|
|
62
64
|
set title "GC Retained"
|
63
65
|
set key on
|
64
66
|
set yrange [0:*]
|
65
67
|
set xrange [0:5]
|
66
68
|
|
67
|
-
plot
|
69
|
+
plot \
|
70
|
+
<% @n.each_with_index do |n, ni| %><% tests.each_with_index do |t, i| %>'<%= File.join(data_dir, 'gc', n.to_s, t) %>' using 2:(\$3-\$4) title '<%= escape(t) + (@n.size == 1 ? '' : " #{n}" ) %>' with steps linestyle <%= i +1 %> dt <%= ni+1 %><%= tests.size == i+1 && @n.last == n ? '' : ", \\\n" %><% end %><% end %>
|
68
71
|
|
69
72
|
# , \\$alloc#{k} using 1:8 with impulses linestyle 7 title 'minor' axes x1y2, \\$alloc#{k} using 1:9 with impulses linestyle 8 title 'major' axes x1y2
|
70
73
|
|
@@ -73,4 +76,5 @@ set key on
|
|
73
76
|
set yrange [0:*]
|
74
77
|
set xrange [0:5]
|
75
78
|
|
76
|
-
plot
|
79
|
+
plot \
|
80
|
+
<% @n.each_with_index do |n, ni| %><% tests.each_with_index do |t, i| %>'<%= File.join(data_dir, 'rss', n.to_s, t) %>' using 2:3 title '<%= escape(t) + (@n.size == 1 ? '' : " #{n}" ) %>' with steps linestyle <%= i +1 %> dt <%= ni+1 %><%= tests.size == i+1 && @n.last == n ? '' : ", \\\n" %><% end %><% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ips
|