stella 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/README.txt +84 -24
  2. data/Rakefile +6 -1
  3. data/lib/stella.rb +5 -4
  4. data/lib/stella/adapter/ab.rb +31 -4
  5. data/lib/stella/adapter/base.rb +15 -1
  6. data/lib/stella/adapter/httperf.rb +35 -4
  7. data/lib/stella/adapter/siege.rb +51 -29
  8. data/lib/stella/cli.rb +45 -22
  9. data/lib/stella/cli/agents.rb +73 -0
  10. data/lib/stella/cli/language.rb +2 -0
  11. data/lib/stella/cli/localtest.rb +5 -0
  12. data/lib/stella/command/base.rb +1 -1
  13. data/lib/stella/command/localtest.rb +84 -68
  14. data/lib/stella/test/{summarybase.rb → base.rb} +3 -7
  15. data/lib/stella/test/definition.rb +10 -5
  16. data/lib/stella/test/{runsummary.rb → run/summary.rb} +4 -6
  17. data/lib/stella/test/{testsummary.rb → summary.rb} +27 -29
  18. data/lib/utils/escape.rb +302 -0
  19. data/lib/utils/mathutil.rb +36 -34
  20. data/support/text/en.yaml +7 -1
  21. metadata +8 -102
  22. data/doc/classes/Crypto.html +0 -248
  23. data/doc/classes/Crypto/Key.html +0 -308
  24. data/doc/classes/Enumerable.html +0 -309
  25. data/doc/classes/FileUtil.html +0 -310
  26. data/doc/classes/HTTPUtil.html +0 -530
  27. data/doc/classes/MathUtil.html +0 -210
  28. data/doc/classes/Stella.html +0 -238
  29. data/doc/classes/Stella/Adapter.html +0 -127
  30. data/doc/classes/Stella/Adapter/ApacheBench.html +0 -1076
  31. data/doc/classes/Stella/Adapter/Base.html +0 -432
  32. data/doc/classes/Stella/Adapter/CommandNotReady.html +0 -146
  33. data/doc/classes/Stella/Adapter/Httperf.html +0 -949
  34. data/doc/classes/Stella/Adapter/Siege.html +0 -1011
  35. data/doc/classes/Stella/CLI.html +0 -914
  36. data/doc/classes/Stella/CLI/Base.html +0 -186
  37. data/doc/classes/Stella/CLI/Language.html +0 -149
  38. data/doc/classes/Stella/CLI/LocalTest.html +0 -268
  39. data/doc/classes/Stella/Command.html +0 -111
  40. data/doc/classes/Stella/Command/Base.html +0 -335
  41. data/doc/classes/Stella/Config.html +0 -292
  42. data/doc/classes/Stella/InvalidArgument.html +0 -242
  43. data/doc/classes/Stella/LocalTest.html +0 -450
  44. data/doc/classes/Stella/Logger.html +0 -548
  45. data/doc/classes/Stella/Response.html +0 -846
  46. data/doc/classes/Stella/Storable.html +0 -928
  47. data/doc/classes/Stella/Test.html +0 -142
  48. data/doc/classes/Stella/Test/DaySummary.html +0 -249
  49. data/doc/classes/Stella/Test/Definition.html +0 -294
  50. data/doc/classes/Stella/Test/Definition/Rampup.html +0 -215
  51. data/doc/classes/Stella/Test/RunSummary.html +0 -315
  52. data/doc/classes/Stella/Test/SummaryBase.html +0 -286
  53. data/doc/classes/Stella/Test/TestSummary.html +0 -200
  54. data/doc/classes/Stella/Text.html +0 -581
  55. data/doc/classes/Stella/Text/Resource.html +0 -289
  56. data/doc/classes/Stella/UnavailableAdapter.html +0 -242
  57. data/doc/classes/Stella/UnknownValue.html +0 -242
  58. data/doc/classes/Stella/UnsupportedLanguage.html +0 -115
  59. data/doc/classes/Stella/Util.html +0 -348
  60. data/doc/classes/TextGraph.html +0 -460
  61. data/doc/classes/TimerUtil.html +0 -431
  62. data/doc/created.rid +0 -1
  63. data/doc/files/LICENSE_txt.html +0 -129
  64. data/doc/files/README_txt.html +0 -209
  65. data/doc/files/lib/stella/adapter/ab_rb.html +0 -101
  66. data/doc/files/lib/stella/adapter/base_rb.html +0 -101
  67. data/doc/files/lib/stella/adapter/httperf_rb.html +0 -101
  68. data/doc/files/lib/stella/adapter/siege_rb.html +0 -101
  69. data/doc/files/lib/stella/cli/base_rb.html +0 -101
  70. data/doc/files/lib/stella/cli/language_rb.html +0 -101
  71. data/doc/files/lib/stella/cli/localtest_rb.html +0 -101
  72. data/doc/files/lib/stella/cli_rb.html +0 -112
  73. data/doc/files/lib/stella/command/base_rb.html +0 -101
  74. data/doc/files/lib/stella/command/localtest_rb.html +0 -101
  75. data/doc/files/lib/stella/logger_rb.html +0 -101
  76. data/doc/files/lib/stella/response_rb.html +0 -101
  77. data/doc/files/lib/stella/storable_rb.html +0 -109
  78. data/doc/files/lib/stella/support_rb.html +0 -101
  79. data/doc/files/lib/stella/test/daysummary_rb.html +0 -101
  80. data/doc/files/lib/stella/test/definition_rb.html +0 -101
  81. data/doc/files/lib/stella/test/runsummary_rb.html +0 -101
  82. data/doc/files/lib/stella/test/summarybase_rb.html +0 -101
  83. data/doc/files/lib/stella/test/testsummary_rb.html +0 -108
  84. data/doc/files/lib/stella/text/resource_rb.html +0 -108
  85. data/doc/files/lib/stella/text_rb.html +0 -108
  86. data/doc/files/lib/stella_rb.html +0 -128
  87. data/doc/files/lib/utils/crypto-key_rb.html +0 -116
  88. data/doc/files/lib/utils/fileutil_rb.html +0 -108
  89. data/doc/files/lib/utils/httputil_rb.html +0 -110
  90. data/doc/files/lib/utils/mathutil_rb.html +0 -101
  91. data/doc/files/lib/utils/textgraph_rb.html +0 -138
  92. data/doc/files/lib/utils/timerutil_rb.html +0 -108
  93. data/doc/fr_class_index.html +0 -66
  94. data/doc/fr_file_index.html +0 -62
  95. data/doc/fr_method_index.html +0 -309
  96. data/doc/index.html +0 -24
  97. data/doc/rdoc-style.css +0 -208
  98. data/lib/stella/test/daysummary.rb +0 -93
  99. data/spec/base.rb +0 -26
  100. data/spec/shell_spec.rb +0 -12
data/README.txt CHANGED
@@ -1,13 +1,20 @@
1
- Stella Tools - Management and reporting tools for performance testing
1
+ Stella - Your Performance Testing Friend
2
+
3
+ Release: 0.5.3-preview (2008-12-23)
4
+
5
+ This is a PREVIEW release. Don't trust and double verify!
2
6
 
3
- Release: 0.5.1 (2008-12-23)
4
7
 
5
8
  == Prerequisites
6
9
 
7
10
  * Linux, *BSD, Solaris
8
11
  * Ruby 1.8.x or 1.9.x
9
12
  * Ruby Libraries
10
- *
13
+ * fastthread
14
+ * mongrel
15
+ * rspec
16
+ * rdoc
17
+
11
18
  * One of:
12
19
  * Apache Bench
13
20
  * Siege
@@ -17,58 +24,111 @@ Release: 0.5.1 (2008-12-23)
17
24
  == Installation
18
25
 
19
26
  Get it in one of the following ways:
20
- * GitHub: http://github.com/solutious/stella
21
- * RubyForge: http://stella.rubyforge.org/
22
- * gem install stella
27
+ * RubyForge: http://stella.rubyforge.org/
28
+ * gem install stella
23
29
 
24
30
  Use ab, siege, and httperf like you normally would with the addition of stella at the beginning (examples are below).
25
31
 
32
+ === Debian (and derivatives)
33
+
34
+ Debian and its derivative (Ubunutu) handling packing a bit differently (see: http://pkg-ruby-extras.alioth.debian.org/rubygems.html). There are a couple errors to watch out for during the installation. The solutions are below:
35
+
36
+ "no such file to load -- mkmf (LoadError)"
37
+
38
+ apt-get install ruby1.8-dev
39
+
40
+ "ERROR: RDoc documentation generator not installed!"
41
+
42
+ apt-get install rdoc
43
+
44
+
26
45
  == Examples
27
46
 
28
- # Run Apache Bench with a warmup and rampup from 100 to 300 virtual users in increments of 25
47
+ Run Apache Bench with a warmup and rampup from 100 to 300 virtual users in increments of 25
48
+
29
49
  stella --warmup=0.5 --rampup=25,300 ab -c 100 -n 10000 http://stellaaahhhh.com/search?term=trooper
30
50
 
31
- # Run Siege, repeat the test 5 times. Automatically creates a summary averages and standard deviations.
32
- stella --datapath=./stella --testruns=5 siege -c 100 -r 100 -b http://stellaaahhhh.com/search?term=flock+of+seagulls
33
-
34
-
51
+
52
+ Run Siege, repeat the test 5 times. Automatically creates a summary averages and standard deviations.
53
+
54
+ stella --agent=ff-3-osx --testruns=5 siege -c 100 -r 100 -b http://stellaaahhhh.com/search?term=flock+of+seagulls
55
+
56
+
57
+ Run Httperf like you normally would (but all the test data will be collected for you)
58
+
59
+ stella httperf --hog --client=0/1 --server=127.0.0.1 --port=5600 --uri=/ --rate=50 --num-conns=3000 --timeout=5
60
+
61
+
35
62
  == Sample Output
36
63
 
37
- $ stella -f csv -x 5 -w -m "httpd 2.2.9-prefork" siege -c 125 -r 100 -b http://stella:5600/
38
- Writing test data to: ./stella/testruns/2008-12-23/test-006
64
+ $ stella -f csv -x 5 -w 0.75 -r 25,125 -m "httpd 2.2.9-prefork" siege -c 75 -r 10 -b http://stella:5600/
65
+ Writing test data to: stella/testruns/2008-12-23/test-054
66
+
67
+ Warmup: 3750@37/1 100% 264.29/s 0.140s 0.024MB/s 0.340MB 14.000s .
39
68
 
40
- Warmup: 125@12 1.1700s 102.56/s 0.1100s (100.00%) .
69
+ -------------------------------------------------------------------
70
+ REQ@VU/s AVAIL REQ/s RTIME DATA/s DATA TIME
71
+
72
+ Run 01: 7500@75/1 100% 345.30/s 0.210s 0.032MB/s 0.690MB 21.720s
73
+ Run 02: 7500@75/1 100% 360.58/s 0.200s 0.033MB/s 0.690MB 20.800s
74
+ Run 03: 7500@75/1 100% 359.02/s 0.210s 0.033MB/s 0.690MB 20.890s
75
+ -------------------------------------------------------------------
76
+ Total: 22500@73 100% 354.97/s 0.207s 0.033MB/s 2.070MB 63.410s
77
+ Std Dev: 6.86/s 0.005s 0.001MB/s 0.414s
78
+
79
+ Run 04: 10000@100/1 100% 384.47/s 0.260s 0.035MB/s 0.920MB 26.010s
80
+ Run 05: 10000@100/1 100% 385.06/s 0.260s 0.035MB/s 0.920MB 25.970s
81
+ Run 06: 10000@100/1 100% 380.95/s 0.260s 0.035MB/s 0.920MB 26.250s
82
+ -------------------------------------------------------------------
83
+ Total: 30000@98 100% 383.49/s 0.260s 0.035MB/s 2.760MB 78.230s
84
+ Std Dev: 1.81/s 0.000s 0.000MB/s 0.124s
85
+
86
+ Run 07: 12500@125/1 100% 397.20/s 0.310s 0.036MB/s 1.140MB 31.470s
87
+ Run 08: 12500@125/1 100% 397.08/s 0.310s 0.036MB/s 1.140MB 31.480s
88
+ Run 09: 12500@125/1 100% 397.58/s 0.310s 0.036MB/s 1.140MB 31.440s
89
+ -------------------------------------------------------------------
90
+ Total: 37500@123 100% 397.29/s 0.310s 0.036MB/s 3.420MB 94.390s
91
+ Std Dev: 0.21/s 0.000s 0.000MB/s 0.017s
41
92
 
42
- Run 01: 1250@125 3.4800s 359.20/s 0.3200s (100.00%)
43
- Run 02: 1250@125 3.4400s 363.37/s 0.3200s (100.00%)
44
- Run 03: 1250@125 5.0000s 250.00/s 0.4700s (100.00%)
45
- Run 04: 1250@125 3.3300s 375.38/s 0.3100s (100.00%)
46
- Run 05: 1250@125 3.4100s 366.57/s 0.3100s (100.00%)
47
93
  -------------------------------------------------------------------
48
- Std Dev: 0.6359s 46.76/s 0.0622s
49
- Total: 6250@116 18.6600s 342.90/s 0.3460s (100.00%)
94
+ Total: 90000@98 100% 378.58/s 0.259s 0.035MB/s 8.250MB 236.030s
95
+ Std Dev: 18.09/s 0.042s 0.002MB/s 4.225s
96
+
50
97
 
51
98
  All test data is collected under ./stella (this can be changed with the parameter --datapath):
99
+
52
100
  $ ls -l ./stella/testruns/2008-12-23/
53
- test-001 test-002 test-003 test-004 test-005 test-006
101
+ test-001 test-002 test-003 test-004 test-005 test-006 ... test-054
54
102
 
103
+
55
104
  A symbolic link points to the most recent test:
105
+
56
106
  $ ls -l ./stella/latest/
57
107
  ID.txt MESSAGE.txt SUMMARY.csv run01 run02 run03 run04 run05 warmup
58
108
 
109
+
59
110
  Each run directory contains all associated data, including the command and configuration
111
+
60
112
  $ ls -l ./stella/latest/run01/
61
113
  COMMAND.txt STDOUT.txt siege.log STDERR.txt SUMMARY.csv siegerc
62
114
 
63
115
 
116
+ == Known Issues
117
+
118
+ * The output for the REQ@VU/s columns is a work in progress. It's not aligned across tools and it will likely change in the next release.
119
+ * The summary data has not been audited. Don't trust and double verify!
120
+ * httperf is functional but needs a lot more testing (most dev was done with ab and siege).
121
+ * The Ruby API has not been finalized. It's functional but there's no example because it is subject to change.
122
+ * There are no specs.
64
123
 
65
124
  == Report an issue
66
125
 
67
126
  Email issues and bugs to stella@solutious.com
68
127
 
69
- == More Information
70
128
 
71
- http://stella.github.com/
129
+ == Even More Information
130
+
131
+ http://www.youtube.com/watch?v=wmq-JDonTpc
72
132
 
73
133
  == License
74
134
 
data/Rakefile CHANGED
@@ -31,7 +31,12 @@ require 'rake/rdoctask'
31
31
  require 'fileutils'
32
32
  include FileUtils
33
33
 
34
- version = "0.5.1"
34
+ STELLA_HOME = File.expand_path(File.join(File.dirname(__FILE__)))
35
+ $: << File.join(STELLA_HOME, 'lib')
36
+
37
+ require 'stella'
38
+ version = Stella::VERSION.to_s
39
+
35
40
  name = "stella"
36
41
 
37
42
  spec = Gem::Specification.new do |s|
@@ -10,6 +10,7 @@ require 'utils/httputil'
10
10
  require 'utils/crypto-key'
11
11
  require 'utils/fileutil'
12
12
  require 'utils/mathutil'
13
+ require 'utils/escape'
13
14
 
14
15
  # Common dependencies
15
16
  require 'stella/support'
@@ -21,8 +22,8 @@ require 'stella/text'
21
22
  require 'stella/logger'
22
23
  require 'stella/response'
23
24
  require 'stella/test/definition'
24
- require 'stella/test/runsummary'
25
- require 'stella/test/testsummary'
25
+ require 'stella/test/run/summary'
26
+ require 'stella/test/summary'
26
27
 
27
28
  # Commands
28
29
  require 'stella/command/base'
@@ -38,13 +39,13 @@ require 'stella/adapter/httperf'
38
39
  # A friend in performance testing.
39
40
  #
40
41
  module Stella
41
- LOGGER = Stella::Logger.new(:debug=>true)
42
+ LOGGER = Stella::Logger.new(:debug=>false)
42
43
  TEXT = Stella::Text.new('en')
43
44
 
44
45
  module VERSION #:nodoc:
45
46
  MAJOR = 0.freeze unless defined? MAJOR
46
47
  MINOR = 5.freeze unless defined? MINOR
47
- TINY = 1.freeze unless defined? TINY
48
+ TINY = 3.freeze unless defined? TINY
48
49
  def self.to_s
49
50
  [MAJOR, MINOR, TINY].join('.')
50
51
  end
@@ -86,9 +86,9 @@ module Stella
86
86
  # because it applies the load factor.
87
87
  value = self.send(canon)
88
88
  if (value.is_a? Array)
89
- value.each { |el| command << "-#{cannon} '#{el}' " }
89
+ value.each { |el| command << "-#{canon} #{EscapeUtil.shell_single_word(el.to_s)} " }
90
90
  else
91
- command << "-#{canon} '#{value}' "
91
+ command << "-#{canon} #{EscapeUtil.shell_single_word(value.to_s)} "
92
92
  end
93
93
 
94
94
  end
@@ -168,7 +168,19 @@ module Stella
168
168
 
169
169
 
170
170
 
171
-
171
+ def add_header(name, value)
172
+ @H ||= []
173
+ @H << "#{name}: #{value}"
174
+ end
175
+
176
+ def user_agent=(list=[])
177
+ return unless list && !list.empty?
178
+ list = list.to_ary
179
+ list.each do |agent|
180
+ add_header("User-Agent", agent)
181
+ end
182
+ end
183
+
172
184
  def vusers
173
185
  c || 0
174
186
  end
@@ -240,7 +252,22 @@ module Stella
240
252
  raw[n.to_sym] = v.to_f unless raw.has_key? n.to_sym
241
253
  }
242
254
 
243
- stats = Stella::Test::RunSummary.new
255
+ # Document Path: /
256
+ # Document Length: 96 bytes
257
+ #
258
+ # Concurrency Level: 75
259
+ # Time taken for tests: 2.001 seconds
260
+ # Complete requests: 750
261
+ # Failed requests: 0
262
+ # Write errors: 0
263
+ # Total transferred: 174000 bytes
264
+ # HTML transferred: 72000 bytes
265
+ # Requests per second: 374.74 [#/sec] (mean)
266
+ # Time per request: 200.138 [ms] (mean)
267
+ # Time per request: 2.669 [ms] (mean, across all concurrent requests)
268
+ # Transfer rate: 84.90 [Kbytes/sec] received
269
+
270
+ stats = Stella::Test::Run::Summary.new
244
271
 
245
272
  unless raw.empty? || !raw.has_key?(:time_taken_for_tests)
246
273
 
@@ -60,13 +60,27 @@ module Stella::Adapter
60
60
  end
61
61
 
62
62
  def name
63
- @command_name
63
+ @name
64
+ end
65
+
66
+ def rate
67
+ 1
68
+ end
69
+ def vuser_rate
70
+ "#{vusers}/#{rate}"
64
71
  end
65
72
 
66
73
  def command
67
74
  raise Stella::TEXT.msg(:error_class_must_override, 'command')
68
75
  end
69
76
 
77
+ def add_header
78
+ raise Stella::TEXT.msg(:error_class_must_override, 'add_header')
79
+ end
80
+
81
+ def user_agent=
82
+ raise Stella::TEXT.msg(:error_class_must_override, 'user_agent=')
83
+ end
70
84
 
71
85
  end
72
86
  end
@@ -55,9 +55,9 @@ module Stella
55
55
  # because it applies the load factor.
56
56
  value = self.send(canon)
57
57
  if (value.is_a? Array)
58
- value.each { |el| command << "--#{canon.tr('_', '-')} '#{el}' " }
58
+ value.each { |el| command << "--#{canon.tr('_', '-')} #{EscapeUtil.shell_single_word(el.to_s)} " }
59
59
  else
60
- command << "--#{canon.tr('_', '-')} '#{value}' "
60
+ command << "--#{canon.tr('_', '-')} #{EscapeUtil.shell_single_word(value.to_s)} "
61
61
  end
62
62
 
63
63
  end
@@ -102,7 +102,7 @@ module Stella
102
102
 
103
103
  opts.on('--add-header=S', String) do |v| @add_header ||= []; @add_header << v; end
104
104
  opts.on('--burst-length=N', Integer) do |v| @burst_length = v end
105
- opts.on('--client=N', Integer) do |v| @client = v end
105
+ opts.on('--client=S', String) do |v| @client = v end
106
106
  opts.on('-d N', '--debug=N', Integer) do |v| @debug ||= 0; @debug = v end
107
107
  opts.on('--failure-status=N', Integer) do |v| @failure_status = v end
108
108
 
@@ -161,6 +161,22 @@ module Stella
161
161
  @name && !instance_variables.empty?
162
162
  end
163
163
 
164
+ def add_header(name=false, value=false)
165
+ # This is a hack since we have an instance variable called add_header.
166
+ # I figure this is the best of two evils because I'd rather keep the
167
+ # instance variable naming consistent.
168
+ return @add_header if !name && !value
169
+ @add_header ||= []
170
+ @add_header << "#{name}: #{value}"
171
+ end
172
+
173
+ def user_agent=(list=[])
174
+ return unless list && !list.empty?
175
+ list = list.to_ary
176
+ list.each do |agent|
177
+ add_header("User-Agent", agent)
178
+ end
179
+ end
164
180
  def vusers
165
181
  @rate
166
182
  end
@@ -176,6 +192,21 @@ module Stella
176
192
  def vuser_requests
177
193
  0
178
194
  end
195
+ def wsess
196
+ @wsess.join(',')
197
+ end
198
+
199
+ def wset
200
+ @wset.join(',')
201
+ end
202
+
203
+
204
+ def wsesslog
205
+ @wsesslog.join(',')
206
+ end
207
+ def wlog
208
+ @wlog.join(',')
209
+ end
179
210
 
180
211
  #def concurrent
181
212
  # (@concurrent * @load_factor).to_i
@@ -235,7 +266,7 @@ module Stella
235
266
  return unless stats_file
236
267
 
237
268
  raw = stats_file.readlines.join
238
- stats = Stella::Test::RunSummary.new
269
+ stats = Stella::Test::Run::Summary.new
239
270
 
240
271
  raw.scan(/Request rate: (\d+?\.\d+?) req.s .(\d+?\.\d+?) ms.req./) do |rate,time|
241
272
  stats.transaction_rate = rate.to_f
@@ -95,9 +95,9 @@ module Stella
95
95
  # because it applies the load factor.
96
96
  value = self.send(canon)
97
97
  if (value.is_a? Array)
98
- value.each { |el| command << "--#{cannon.tr('_', '-')} '#{el}' " }
98
+ value.each { |el| command << "--#{canon.tr('_', '-')} #{EscapeUtil.shell_single_word(el.to_s)} " }
99
99
  else
100
- command << "--#{canon.tr('_', '-')} '#{value}' "
100
+ command << "--#{canon.tr('_', '-')} #{EscapeUtil.shell_single_word(value.to_s)} "
101
101
  end
102
102
 
103
103
  end
@@ -118,24 +118,24 @@ module Stella
118
118
  def process_options(arguments)
119
119
  options = OpenStruct.new
120
120
  opts = OptionParser.new
121
- opts.on('-V', '--version') do |v| options.version = v end
122
- opts.on('-h', '--help') do |v| options.help = v end
123
- opts.on('-C', '--config') do |v| options.config = v end
124
- opts.on('-v', '--verbose') do |v| options.verbose = v end
125
- opts.on('-g', '--get') do |v| options.get = v end
126
- opts.on('-l', '--log') do |v| options.log = v end
127
- opts.on('-m S', '--mark=S', String) do |v| options.mark = v end
128
- opts.on('-d N', '--delay=N', Float) do |v| options.delay = v end
129
- opts.on('-H S', '--header=S', String) do |v| options.header ||= []; options.header << v end
121
+ opts.on('-V', '--version') do |v| @version = v end
122
+ opts.on('-h', '--help') do |v| @help = v end
123
+ opts.on('-C', '--config') do |v| @config = v end
124
+ opts.on('-v', '--verbose') do |v| @verbose = v end
125
+ opts.on('-g', '--get') do |v| @get = v end
126
+ opts.on('-l', '--log') do |v| @log = v end
127
+ opts.on('-m S', '--mark=S', String) do |v| @mark = v end
128
+ opts.on('-d N', '--delay=N', Float) do |v| @delay = v end
129
+ opts.on('-H S', '--header=S', String) do |v| @header ||= []; @header << v end
130
130
 
131
- opts.on('-r N', '--reps=N', Integer) do |v| options.reps = v.to_i end
132
- opts.on('-c N', '--concurrent=N', Integer) do |v| options.concurrent = v.to_i end
133
- opts.on('-R S', '--rc=S', String) do |v| options.rc = v end
134
- opts.on('-f S', '--file=S', String) do |v| options.file = v end
135
- opts.on('-t S', '--time=S', String) do |v| options.time = v end
136
- opts.on('-b', '--benchmark') do |v| options.benchmark = true; end
137
- opts.on('-i', '--internet') do |v| options.internet = true; end
138
- opts.on('-A S', '--user-agent=S', String) do |v| options.user_agent = v end
131
+ opts.on('-r N', '--reps=N', Integer) do |v| @reps = v.to_i end
132
+ opts.on('-c N', '--concurrent=N', Integer) do |v| @concurrent = v.to_i end
133
+ opts.on('-R S', '--rc=S', String) do |v| @rc = v end
134
+ opts.on('-f S', '--file=S', String) do |v| @file = v end
135
+ opts.on('-t S', '--time=S', String) do |v| @time = v end
136
+ opts.on('-b', '--benchmark') do |v| @benchmark = true; end
137
+ opts.on('-i', '--internet') do |v| @internet = true; end
138
+ opts.on('-A S', '--user-agent=S', String) do |v| @user_agent ||= []; @user_agent << v end
139
139
 
140
140
  raise "You cannot select both --internet and --benchmark" if options.internet && options.benchmark
141
141
 
@@ -150,7 +150,19 @@ module Stella
150
150
  raise InvalidArgument.new(badarg)
151
151
  end
152
152
 
153
-
153
+
154
+ def add_header(name, value)
155
+ @header ||= []
156
+ @header << "#{name}: #{value}"
157
+ end
158
+ def user_agent=(list=[])
159
+ return unless list && !list.empty?
160
+ list = list.to_ary
161
+ @user_agent ||= []
162
+ @user_agent << list
163
+ @user_agent.flatten
164
+ end
165
+
154
166
  def vusers
155
167
  concurrent || 0
156
168
  end
@@ -272,23 +284,33 @@ module Stella
272
284
  raw[n.to_sym] = v.to_f
273
285
  }
274
286
 
275
- stats = Stella::Test::RunSummary.new
276
-
287
+ stats = Stella::Test::Run::Summary.new
288
+
289
+ # Transactions: 750 hits
290
+ # Availability: 100.00 %
291
+ # Elapsed time: 2.33 secs
292
+ # Data transferred: 0.07 MB
293
+ # Response time: 0.21 secs
294
+ # Transaction rate: 321.89 trans/sec
295
+ # Throughput: 0.03 MB/sec
296
+ # Concurrency: 67.49
297
+ # Successful transactions: 750
298
+ # Failed transactions: 0
299
+ # Longest transaction: 0.33
300
+ # Shortest transaction: 0.10
301
+
277
302
  stats.vusers = raw[:concurrency]
278
303
  stats.data_transferred = raw[:data_transferred]
279
-
280
-
281
304
  stats.elapsed_time = raw[:elapsed_time]
282
305
  stats.response_time = raw[:response_time]
283
-
284
- #stats.shortest_transaction = raw[:shortest_transaction]
285
- #stats.longest_transaction = raw[:longest_transaction]
286
-
287
306
  stats.transactions = raw[:transactions].to_i
288
307
  stats.transaction_rate = raw[:transaction_rate]
289
308
  stats.failed = raw[:failed_transactions].to_i
290
309
  stats.successful = raw[:successful_transactions].to_i
291
- #stats.raw = raw if @global_options.debug
310
+
311
+ #stats.shortest_transaction = raw[:shortest_transaction]
312
+ #stats.longest_transaction = raw[:longest_transaction]
313
+
292
314
  stats
293
315
  end
294
316