hansel 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md ADDED
File without changes
data/README.markdown ADDED
@@ -0,0 +1,121 @@
1
+ hansel
2
+ ======
3
+
4
+ Hansel is a pure ruby driver for httperf for automated load and performance testing. It will load
5
+ a job queue file, in a yaml format, run httperf with each job
6
+
7
+ Installing Httperf and Hansel
8
+ -----------------------------
9
+
10
+ ## Httperf
11
+
12
+ For Linux (Ubuntu):
13
+
14
+ apt-get update && apt-get -y install rubygems httperf ruby1.8-dev libcurl4-gnutls-dev
15
+ gem install rubygems-update
16
+ export PATH=$PATH:/var/lib/gems/1.8/bin
17
+ update_rubygems
18
+ gem install hansel
19
+
20
+ On MacOS X using homebrew:
21
+
22
+ brew install httperf
23
+ gem install hansel
24
+
25
+
26
+ ## Optional -- Installing Octave (warning: long!)
27
+
28
+ brew install gfortran octave
29
+
30
+ or with MacPorts:
31
+
32
+ sudo port install octave
33
+
34
+ Example usage
35
+ -------------
36
+
37
+ Create a job queue file in ~/.hansel/jobs.yml:
38
+
39
+ ---
40
+ - :server: www.example.com
41
+ :uri: /
42
+ :num_conns: 50
43
+ :low_rate: 10
44
+ :high_rate: 50
45
+ :rate_step: 10
46
+
47
+ - :server: www.apple.com
48
+ :uri: /
49
+ :num_conns: 50
50
+ :low_rate: 10
51
+ :high_rate: 50
52
+ :rate_step: 10
53
+
54
+ and run Hansel
55
+
56
+ hansel --verbose --format=octave
57
+
58
+ By default, the output is written into the ~/hansel_output directory. When the octave format is
59
+ specified, it uses the default template octave.m.erb in the project templates. Here is a sample
60
+ output from the previous job:
61
+
62
+ rate = [5, 10, 15, 20];
63
+ request_rate = [5.1, 9.3, 12.9, 15.8];
64
+ connection_rate = [5.1, 9.3, 12.9, 15.8];
65
+ reply_rate_avg = [0.0, 0.0, 0.0, 0.0];
66
+ reply_rate_max = [0.0, 0.0, 0.0, 0.0];
67
+ reply_time = [88.4, 93.4, 89.2, 89.1];
68
+ reply_rate_stddev = [0.0, 0.0, 0.0, 0.0];
69
+ errors = [0, 0, 0, 0];
70
+
71
+ plot(rate, request_rate, '-k*');
72
+ hold on;
73
+ plot(rate, connection_rate, '-kd');
74
+ hold on;
75
+ plot(rate, reply_rate_max, '-kp');
76
+ hold on;
77
+ plot(rate, reply_rate_max, '-k+');
78
+ hold on;
79
+ plot(rate, reply_rate_stddev, '-kh');
80
+ hold on;
81
+ plot(rate, reply_time, '-g*');
82
+ hold on;
83
+ plot(rate, errors, '-r*');
84
+
85
+ grid on;
86
+
87
+ axis([0 20 0 20]);
88
+ title('Hansel report for www.example.com:80/ (10 connections per run)')
89
+ xlabel('Demanded Request Rate');
90
+ legend('Request Rate', 'Connection Rate', 'Avg. reply rate', 'Max. reply rate', 'Reply rate StdDev', 'Reply time', 'Errors');
91
+ print('/Users/paulm/hansel_output/hansel-10.m.png', '-dpng')
92
+
93
+ Run octave on it will produce graph as a png file.
94
+
95
+ Note on Patches/Pull Requests
96
+ -----------------------------
97
+
98
+ * Fork the project.
99
+ * Make your feature addition or bug fix.
100
+ * Add tests for it. This is important so I don't break it in a
101
+ future version unintentionally.
102
+ * Commit, do not mess with rakefile, version, or history.
103
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
104
+ * Send me a pull request. Bonus points for topic branches.
105
+
106
+ Meta
107
+ ----
108
+
109
+ * Code: `git clone git://github.com/xlymian/hansel.git`
110
+ * Home: <http://github.com/xlymian/hansel>
111
+ * Docs: <http://defunkt.github.com/resque/>
112
+ * Bugs: <http://github.com/xlymian/hansel/issues>
113
+
114
+ References
115
+ ----------
116
+
117
+ * HTTP Perforance Testing with httperf: <http://agiletesting.blogspot.com/2005/04/http-performance-testing-with-httperf.html>
118
+
119
+ Copyright
120
+ ---------
121
+ Copyright (c) 2009 Paul Mylchreest. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,49 +1,21 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require "spec/rake/spectask"
6
- rescue LoadError
7
- puts "rspec (or a dependency) not available. Install it with: gem install rspec"
8
- end
9
-
10
- task :default => :spec
11
-
12
- Spec::Rake::SpecTask.new do |t|
13
- t.spec_opts = %w(-fs -c)
14
- t.spec_files = FileList["spec/**_spec.rb"]
15
- end
16
-
17
1
  begin
2
+ require 'bundler'
3
+ require 'rspec/core/rake_task'
18
4
  require 'metric_fu'
5
+ Bundler.setup
19
6
  rescue LoadError
20
- puts "metric_fu (or a dependency) not available. Install it with: gem install metric_fu"
7
+ puts '*** You must `gem install bundler` and `bundle install` to run rake tasks'
21
8
  end
22
9
 
23
- begin
24
- require 'jeweler'
25
- Jeweler::Tasks.new do |gem|
26
- gem.name = "hansel"
27
- gem.executables = "hansel"
28
- gem.summary = %Q{Ruby driver for httperf - automated load and performance testing}
29
- gem.description = %Q{Ruby driver for httperf - automated load and performance testing}
30
- gem.email = "paul.mylchreest@mac.com"
31
- gem.homepage = "http://github.com/xlymian/hansel"
32
- gem.authors = ["Paul Mylchreest"]
33
-
34
- gem.add_dependency 'typhoeus'
35
-
36
- gem.add_development_dependency 'rspec'
37
- gem.add_development_dependency 'gherkin'
38
- gem.add_development_dependency 'cucumber'
10
+ $LOAD_PATH.unshift 'lib'
11
+ # require 'hansel/tasks'
39
12
 
40
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
41
- end
42
- Jeweler::GemcutterTasks.new
43
- rescue LoadError
44
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
13
+ RSpec::Core::RakeTask.new do |t|
14
+ t.rspec_opts = [ "--color" ]
45
15
  end
46
16
 
17
+ task :default => :spec
18
+
47
19
  MetricFu::Configuration.run do |config|
48
20
  #define which metrics you want to use
49
21
  config.metrics = [:churn, :saikuro, :flog, :flay, :reek, :roodi]
@@ -75,3 +47,15 @@ MetricFu::Configuration.run do |config|
75
47
 
76
48
  config.graph_engine = :bluff
77
49
  end
50
+
51
+ desc "Push a new version to Gemcutter"
52
+ task :publish do
53
+ require 'hansel/version'
54
+
55
+ sh "gem build hansel.gemspec"
56
+ sh "gem push hansel-#{HanselCore::Version}.gem"
57
+ sh "git tag v#{HanselCore::Version}"
58
+ sh "git push origin v#{HanselCore::Version}"
59
+ sh "git push origin master"
60
+ sh "git clean -fd"
61
+ end
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module HanselCore
2
4
  #
3
5
  # Parse the command configuration file options and command line arguments.
@@ -0,0 +1,3 @@
1
+ module HanselCore
2
+ Version = VERSION = '0.2.9'
3
+ end
@@ -89,26 +89,5 @@ describe HanselCore::ArgParser, "#parse" do
89
89
  @options.verbose.should == false
90
90
  end
91
91
  end
92
-
93
- describe "help is set" do
94
- it "should set exit to true" do
95
- @argv = [ '--help' ]
96
- @options = HanselCore::ArgParser.new(@argv).parse
97
- @options.exit.should == true
98
- end
99
- it "should set exit to true" do
100
- @argv = [ '-h' ]
101
- @options = HanselCore::ArgParser.new(@argv).parse
102
- @options.exit.should == true
103
- end
104
- end
105
-
106
- describe "version is set" do
107
- it "should set exit to true" do
108
- @argv = [ '--version' ]
109
- @options = HanselCore::ArgParser.new(@argv).parse
110
- @options.exit.should == true
111
- end
112
- end
113
92
  end
114
93
  end
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,5 @@
1
- require "rubygems"
2
- require 'spec'
1
+ require 'rubygems'
2
+ require 'bundler'
3
3
  require 'lib/hansel'
4
4
 
5
- module Helpers
6
- end
7
-
8
- Spec::Runner.configure do |config|
9
- config.include Helpers
10
- end
5
+ Bundler.setup
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hansel
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 5
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 8
9
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
10
11
  platform: ruby
11
12
  authors:
12
13
  - Paul Mylchreest
@@ -14,58 +15,11 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-19 00:00:00 -04:00
18
- default_executable: hansel
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: typhoeus
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
30
- type: :runtime
31
- version_requirements: *id001
32
- - !ruby/object:Gem::Dependency
33
- name: rspec
34
- prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- segments:
40
- - 0
41
- version: "0"
42
- type: :development
43
- version_requirements: *id002
44
- - !ruby/object:Gem::Dependency
45
- name: gherkin
46
- prerelease: false
47
- requirement: &id003 !ruby/object:Gem::Requirement
48
- requirements:
49
- - - ">="
50
- - !ruby/object:Gem::Version
51
- segments:
52
- - 0
53
- version: "0"
54
- type: :development
55
- version_requirements: *id003
56
- - !ruby/object:Gem::Dependency
57
- name: cucumber
58
- prerelease: false
59
- requirement: &id004 !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- segments:
64
- - 0
65
- version: "0"
66
- type: :development
67
- version_requirements: *id004
68
- description: Ruby driver for httperf - automated load and performance testing
18
+ date: 2011-06-13 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: " Hansel is a pure ruby driver for httperf for automated load and\n performance testing. It will load a job queue file, in a yaml format, run\n httperf with each job.\n"
69
23
  email: paul.mylchreest@mac.com
70
24
  executables:
71
25
  - hansel
@@ -73,17 +27,13 @@ extensions: []
73
27
 
74
28
  extra_rdoc_files:
75
29
  - LICENSE
76
- - README.rdoc
30
+ - README.markdown
77
31
  files:
78
- - .document
79
- - .gitignore
80
- - LICENSE
81
- - README.rdoc
32
+ - README.markdown
82
33
  - Rakefile
83
- - VERSION
34
+ - LICENSE
35
+ - HISTORY.md
84
36
  - bin/hansel
85
- - hansel.gemspec
86
- - lib/hansel.rb
87
37
  - lib/hansel/arg_parser.rb
88
38
  - lib/hansel/formatting/csv_formatter.rb
89
39
  - lib/hansel/formatting/formatting.rb
@@ -94,6 +44,8 @@ files:
94
44
  - lib/hansel/httperf_result.rb
95
45
  - lib/hansel/httperf_result_parser.rb
96
46
  - lib/hansel/job_queue/job_queue.rb
47
+ - lib/hansel/version.rb
48
+ - lib/hansel.rb
97
49
  - spec/arg_parser_spec.rb
98
50
  - spec/hansel_spec.rb
99
51
  - spec/httperf_result_parser_spec.rb
@@ -110,28 +62,29 @@ rdoc_options:
110
62
  require_paths:
111
63
  - lib
112
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
113
66
  requirements:
114
67
  - - ">="
115
68
  - !ruby/object:Gem::Version
69
+ hash: 3
116
70
  segments:
117
71
  - 0
118
72
  version: "0"
119
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
120
75
  requirements:
121
76
  - - ">="
122
77
  - !ruby/object:Gem::Version
78
+ hash: 3
123
79
  segments:
124
80
  - 0
125
81
  version: "0"
126
82
  requirements: []
127
83
 
128
84
  rubyforge_project:
129
- rubygems_version: 1.3.6
85
+ rubygems_version: 1.6.2
130
86
  signing_key:
131
87
  specification_version: 3
132
- summary: Ruby driver for httperf - automated load and performance testing
133
- test_files:
134
- - spec/arg_parser_spec.rb
135
- - spec/hansel_spec.rb
136
- - spec/httperf_result_parser_spec.rb
137
- - spec/spec_helper.rb
88
+ summary: Ruby driver for httperf - automated load and performance testing.
89
+ test_files: []
90
+
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,24 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## metric_fu
5
- tmp/*
6
-
7
- ## TEXTMATE
8
- *.tmproj
9
- tmtags
10
-
11
- ## EMACS
12
- *~
13
- \#*
14
- .\#*
15
-
16
- ## VIM
17
- *.swp
18
-
19
- ## PROJECT::GENERAL
20
- coverage
21
- rdoc
22
- pkg
23
-
24
- ## PROJECT::SPECIFIC
data/README.rdoc DELETED
@@ -1,106 +0,0 @@
1
- = hansel
2
-
3
- Hansel is a pure ruby driver for httperf for automated load and performance testing. It will load
4
- a job queue file, in a yaml format, run httperf with each job
5
-
6
- = Installing Httperf and Hansel
7
-
8
- == Httperf
9
-
10
- For Linux (Ubuntu):
11
-
12
- apt-get update && apt-get -y install rubygems httperf ruby1.8-dev libcurl4-gnutls-dev
13
- gem install rubygems-update
14
- export PATH=$PATH:/var/lib/gems/1.8/bin
15
- update_rubygems
16
-
17
- On MacOS X using homebrew:
18
-
19
- brew install httperf
20
-
21
- finally:
22
-
23
- gem install hansel
24
-
25
- == Optional -- Installing Octave using macports (warning: long!)
26
-
27
- sudo port install octave
28
-
29
- = Example usage
30
-
31
- Create a job queue file in ~/.hansel/jobs.yml:
32
-
33
- ---
34
- - :server: www.example.com
35
- :uri: /
36
- :num_conns: 50
37
- :low_rate: 10
38
- :high_rate: 50
39
- :rate_step: 10
40
-
41
- - :server: www.apple.com
42
- :uri: /
43
- :num_conns: 50
44
- :low_rate: 10
45
- :high_rate: 50
46
- :rate_step: 10
47
-
48
- and run Hansel
49
-
50
- hansel --verbose --format=octave
51
-
52
- By default, the output is written into the ~/hansel_output directory. When the octave format is
53
- specified, it uses the default template octave.m.erb in the project templates. Here is a sample
54
- output from the previous job:
55
-
56
- rate = [5, 10, 15, 20];
57
- request_rate = [5.1, 9.3, 12.9, 15.8];
58
- connection_rate = [5.1, 9.3, 12.9, 15.8];
59
- reply_rate_avg = [0.0, 0.0, 0.0, 0.0];
60
- reply_rate_max = [0.0, 0.0, 0.0, 0.0];
61
- reply_time = [88.4, 93.4, 89.2, 89.1];
62
- reply_rate_stddev = [0.0, 0.0, 0.0, 0.0];
63
- errors = [0, 0, 0, 0];
64
-
65
- plot(rate, request_rate, '-k*');
66
- hold on;
67
- plot(rate, connection_rate, '-kd');
68
- hold on;
69
- plot(rate, reply_rate_max, '-kp');
70
- hold on;
71
- plot(rate, reply_rate_max, '-k+');
72
- hold on;
73
- plot(rate, reply_rate_stddev, '-kh');
74
- hold on;
75
- plot(rate, reply_time, '-g*');
76
- hold on;
77
- plot(rate, errors, '-r*');
78
-
79
- grid on;
80
-
81
- axis([0 20 0 20]);
82
- title('Hansel report for www.example.com:80/ (10 connections per run)')
83
- xlabel('Demanded Request Rate');
84
- legend('Request Rate', 'Connection Rate', 'Avg. reply rate', 'Max. reply rate', 'Reply rate StdDev', 'Reply time', 'Errors');
85
- print('/Users/paulm/hansel_output/hansel-10.m.png', '-dpng')
86
-
87
- Run octave on it will produce graph as a png file.
88
-
89
- == Note on Patches/Pull Requests
90
-
91
- * Fork the project.
92
- * Make your feature addition or bug fix.
93
- * Add tests for it. This is important so I don't break it in a
94
- future version unintentionally.
95
- * Commit, do not mess with rakefile, version, or history.
96
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
97
- * Send me a pull request. Bonus points for topic branches.
98
-
99
- == References
100
-
101
- "HTTP Perforance Testing with httperf":http://agiletesting.blogspot.com/2005/04/http-performance-testing-with-httperf.html
102
- "Perforance vs Load Testing":http://agiletesting.blogspot.com/2005/04/more-on-performance-vs-load-testing.html
103
-
104
- == Copyright
105
-
106
- Copyright (c) 2010 Paul Mylchreest. See LICENSE for details.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.8
data/hansel.gemspec DELETED
@@ -1,82 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{hansel}
8
- s.version = "0.2.8"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Paul Mylchreest"]
12
- s.date = %q{2010-06-19}
13
- s.default_executable = %q{hansel}
14
- s.description = %q{Ruby driver for httperf - automated load and performance testing}
15
- s.email = %q{paul.mylchreest@mac.com}
16
- s.executables = ["hansel"]
17
- s.extra_rdoc_files = [
18
- "LICENSE",
19
- "README.rdoc"
20
- ]
21
- s.files = [
22
- ".document",
23
- ".gitignore",
24
- "LICENSE",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "bin/hansel",
29
- "hansel.gemspec",
30
- "lib/hansel.rb",
31
- "lib/hansel/arg_parser.rb",
32
- "lib/hansel/formatting/csv_formatter.rb",
33
- "lib/hansel/formatting/formatting.rb",
34
- "lib/hansel/formatting/octave_formatter.rb",
35
- "lib/hansel/formatting/yaml_formatter.rb",
36
- "lib/hansel/hansel.rb",
37
- "lib/hansel/httperf/httperf.rb",
38
- "lib/hansel/httperf_result.rb",
39
- "lib/hansel/httperf_result_parser.rb",
40
- "lib/hansel/job_queue/job_queue.rb",
41
- "spec/arg_parser_spec.rb",
42
- "spec/hansel_spec.rb",
43
- "spec/httperf_result_parser_spec.rb",
44
- "spec/jobs.yml",
45
- "spec/spec_helper.rb",
46
- "templates/octave.m.erb"
47
- ]
48
- s.homepage = %q{http://github.com/xlymian/hansel}
49
- s.rdoc_options = ["--charset=UTF-8"]
50
- s.require_paths = ["lib"]
51
- s.rubygems_version = %q{1.3.6}
52
- s.summary = %q{Ruby driver for httperf - automated load and performance testing}
53
- s.test_files = [
54
- "spec/arg_parser_spec.rb",
55
- "spec/hansel_spec.rb",
56
- "spec/httperf_result_parser_spec.rb",
57
- "spec/spec_helper.rb"
58
- ]
59
-
60
- if s.respond_to? :specification_version then
61
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
62
- s.specification_version = 3
63
-
64
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
65
- s.add_runtime_dependency(%q<typhoeus>, [">= 0"])
66
- s.add_development_dependency(%q<rspec>, [">= 0"])
67
- s.add_development_dependency(%q<gherkin>, [">= 0"])
68
- s.add_development_dependency(%q<cucumber>, [">= 0"])
69
- else
70
- s.add_dependency(%q<typhoeus>, [">= 0"])
71
- s.add_dependency(%q<rspec>, [">= 0"])
72
- s.add_dependency(%q<gherkin>, [">= 0"])
73
- s.add_dependency(%q<cucumber>, [">= 0"])
74
- end
75
- else
76
- s.add_dependency(%q<typhoeus>, [">= 0"])
77
- s.add_dependency(%q<rspec>, [">= 0"])
78
- s.add_dependency(%q<gherkin>, [">= 0"])
79
- s.add_dependency(%q<cucumber>, [">= 0"])
80
- end
81
- end
82
-