hansel 0.2.19 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ module HanselCore
32
32
  { :output_file_name => file_name,
33
33
  :template => template,
34
34
  :description => @description,
35
- :png_file_name => [ @server, @port, description, num_conns.to_s ].compact.join('-')
35
+ :png_file_name => [ @server.gsub('.', '_'), @port, description, num_conns.to_s ].compact.join('_')
36
36
  }).format
37
37
  end
38
38
  end
@@ -51,8 +51,8 @@ module HanselCore
51
51
  def output_filename
52
52
  part = [ @current_job && @current_job.description, ( yield if block_given? ) ].compact
53
53
  type = { :yaml => 'yml', :csv => 'csv', :octave => 'm' }[options.format.to_sym]
54
- @server, @port = (res = results.first) && res.server, res.port
55
- fname = [@server, @port, (part unless part.empty?)].compact.join('-')
54
+ @server, @port, @num_conns = (res = results.first) && res.server, res.port, res.num_conns
55
+ fname = [ @server.gsub('.', '_'), @port, (part unless part.empty?), @num_conns ].compact.join('_')
56
56
  [ File.join( [options.output_dir, fname] ), type ].join('.')
57
57
  end
58
58
  end
@@ -10,7 +10,7 @@ module HanselCore
10
10
  @template = options[:template]
11
11
  @rates = @data.map &:rate
12
12
  @max_rate = @rates.max
13
- @png_output = options[:png_file_name].gsub( '.', '-') # make latex happy
13
+ @png_output = options[:png_file_name].gsub( '.', '_') # make latex happy
14
14
  @description = options[:description]
15
15
  end
16
16
 
@@ -9,11 +9,11 @@ namespace :hansel do
9
9
  desc "Generate octave plot for a file"
10
10
  data = YAML.load_file( args.input_file ).collect{ |o| OpenStruct.new o.ivars }
11
11
  template = File.join( [ File.dirname(__FILE__),
12
- '../../templates',
12
+ '../../../templates',
13
13
  'multiplot.m.erb' ] )
14
14
  first = data.first
15
15
  output_dir = args.output_dir
16
- output_name = args.input_file.split('/').last.gsub( '.', '-') + '.m'
16
+ output_name = args.input_file.split('/').last.gsub( '.', '_') + '.m'
17
17
  output_file = File.join([ output_dir, output_name ])
18
18
  File.open( output_file, 'w+' ) do |output|
19
19
  output.puts HanselCore::OctaveFormatter.new(data,
@@ -21,9 +21,10 @@ namespace :hansel do
21
21
  :template => template,
22
22
  :description => first.description,
23
23
  :png_file_name => [ first.server,
24
+ first.port,
24
25
  first.description,
25
26
  first.num_conns.to_s
26
- ].compact.join('-')
27
+ ].compact.join('_')
27
28
  }).format
28
29
  end
29
30
  end
@@ -1,3 +1,3 @@
1
1
  module HanselCore
2
- Version = VERSION = '0.2.19' unless defined? HanselCore::VERSION
2
+ Version = VERSION = '0.2.20' unless defined? HanselCore::VERSION
3
3
  end
@@ -82,7 +82,7 @@ describe HanselCore, "in general" do
82
82
 
83
83
  describe "calling output" do
84
84
  before :each do
85
- @default_name = File.join [ @hansel.options.output_dir, 'localhost-80.yml' ]
85
+ @default_name = File.join [ @hansel.options.output_dir, 'localhost_80_1.yml' ]
86
86
  FileUtils.rm @default_name if File.exists? @default_name
87
87
  @hansel.output
88
88
  end
@@ -8,28 +8,21 @@ reply_rate_stddev = [<%= @data.map(&:reply_rate_stddev).join(', ') %>];
8
8
  errors = [<%= @data.map(&:errors).join(', ') %>];
9
9
 
10
10
  <% pages = [
11
- [
12
- { :ylabel => 'Request Rate', :yvar => 'request_rate' },
13
- { :ylabel => 'Connection Rate', :yvar => 'connection_rate' },
14
- { :ylabel => 'Reply time', :yvar => 'reply_time' },
15
- ],
16
- [
17
- { :ylabel => 'Avg. reply rate', :yvar => 'reply_rate_avg' },
18
- { :ylabel => 'Max. reply rate', :yvar => 'reply_rate_max' },
19
- { :ylabel => 'Reply rate StdDev', :yvar => 'reply_rate_stddev' },
20
- { :ylabel => 'Errors', :yvar => 'errors' },
21
- ]
11
+ { :ylabel => 'Request Rate', :yvar => 'request_rate' },
12
+ { :ylabel => 'Connection Rate', :yvar => 'connection_rate' },
13
+ { :ylabel => 'Reply time', :yvar => 'reply_time' },
14
+ { :ylabel => 'Avg. reply rate', :yvar => 'reply_rate_avg' },
15
+ { :ylabel => 'Max. reply rate', :yvar => 'reply_rate_max' },
16
+ { :ylabel => 'Reply rate StdDev', :yvar => 'reply_rate_stddev' },
17
+ { :ylabel => 'Errors', :yvar => 'errors' }
22
18
  ]
23
19
  %>
24
20
 
25
- <% pages.each_with_index do |page, page_num| %>
26
- <% page.each_with_index do |plot, i| %>
27
- title('<%= plot[:ylabel] %>')
28
- subplot (2, 2, <%= i + 1 %>)
29
- plot(rate, <%= plot[:yvar] %>, '-k*');
21
+ <% pages.each do |page| %>
22
+ title('<%= page[:ylabel] %>')
23
+ plot(rate, <%= page[:yvar] %>, '-k*');
30
24
  xlabel('Demanded Request Rate');
31
- ylabel('<%= plot[:ylabel] %>');
25
+ ylabel('<%= page[:ylabel] %>');
32
26
  grid on;
33
- <% end %>
34
- print('<%= "#{@png_output}-#{page_num + 1}" %>.png', '-dpng')
27
+ print('<%= "#{@png_output}-#{page[:yvar]}" %>.png', '-dpng')
35
28
  <% end %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hansel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 19
10
- version: 0.2.19
9
+ - 20
10
+ version: 0.2.20
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Mylchreest
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-05 00:00:00 -04:00
18
+ date: 2011-07-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -43,7 +43,7 @@ files:
43
43
  - lib/hansel/httperf_result.rb
44
44
  - lib/hansel/httperf_result_parser.rb
45
45
  - lib/hansel/job_queue/job_queue.rb
46
- - lib/hansel/tasks.rake
46
+ - lib/hansel/tasks/octave.rake
47
47
  - lib/hansel/version.rb
48
48
  - lib/hansel.rb
49
49
  - spec/arg_parser_spec.rb