stella 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +84 -24
- data/Rakefile +6 -1
- data/lib/stella.rb +5 -4
- data/lib/stella/adapter/ab.rb +31 -4
- data/lib/stella/adapter/base.rb +15 -1
- data/lib/stella/adapter/httperf.rb +35 -4
- data/lib/stella/adapter/siege.rb +51 -29
- data/lib/stella/cli.rb +45 -22
- data/lib/stella/cli/agents.rb +73 -0
- data/lib/stella/cli/language.rb +2 -0
- data/lib/stella/cli/localtest.rb +5 -0
- data/lib/stella/command/base.rb +1 -1
- data/lib/stella/command/localtest.rb +84 -68
- data/lib/stella/test/{summarybase.rb → base.rb} +3 -7
- data/lib/stella/test/definition.rb +10 -5
- data/lib/stella/test/{runsummary.rb → run/summary.rb} +4 -6
- data/lib/stella/test/{testsummary.rb → summary.rb} +27 -29
- data/lib/utils/escape.rb +302 -0
- data/lib/utils/mathutil.rb +36 -34
- data/support/text/en.yaml +7 -1
- metadata +8 -102
- data/doc/classes/Crypto.html +0 -248
- data/doc/classes/Crypto/Key.html +0 -308
- data/doc/classes/Enumerable.html +0 -309
- data/doc/classes/FileUtil.html +0 -310
- data/doc/classes/HTTPUtil.html +0 -530
- data/doc/classes/MathUtil.html +0 -210
- data/doc/classes/Stella.html +0 -238
- data/doc/classes/Stella/Adapter.html +0 -127
- data/doc/classes/Stella/Adapter/ApacheBench.html +0 -1076
- data/doc/classes/Stella/Adapter/Base.html +0 -432
- data/doc/classes/Stella/Adapter/CommandNotReady.html +0 -146
- data/doc/classes/Stella/Adapter/Httperf.html +0 -949
- data/doc/classes/Stella/Adapter/Siege.html +0 -1011
- data/doc/classes/Stella/CLI.html +0 -914
- data/doc/classes/Stella/CLI/Base.html +0 -186
- data/doc/classes/Stella/CLI/Language.html +0 -149
- data/doc/classes/Stella/CLI/LocalTest.html +0 -268
- data/doc/classes/Stella/Command.html +0 -111
- data/doc/classes/Stella/Command/Base.html +0 -335
- data/doc/classes/Stella/Config.html +0 -292
- data/doc/classes/Stella/InvalidArgument.html +0 -242
- data/doc/classes/Stella/LocalTest.html +0 -450
- data/doc/classes/Stella/Logger.html +0 -548
- data/doc/classes/Stella/Response.html +0 -846
- data/doc/classes/Stella/Storable.html +0 -928
- data/doc/classes/Stella/Test.html +0 -142
- data/doc/classes/Stella/Test/DaySummary.html +0 -249
- data/doc/classes/Stella/Test/Definition.html +0 -294
- data/doc/classes/Stella/Test/Definition/Rampup.html +0 -215
- data/doc/classes/Stella/Test/RunSummary.html +0 -315
- data/doc/classes/Stella/Test/SummaryBase.html +0 -286
- data/doc/classes/Stella/Test/TestSummary.html +0 -200
- data/doc/classes/Stella/Text.html +0 -581
- data/doc/classes/Stella/Text/Resource.html +0 -289
- data/doc/classes/Stella/UnavailableAdapter.html +0 -242
- data/doc/classes/Stella/UnknownValue.html +0 -242
- data/doc/classes/Stella/UnsupportedLanguage.html +0 -115
- data/doc/classes/Stella/Util.html +0 -348
- data/doc/classes/TextGraph.html +0 -460
- data/doc/classes/TimerUtil.html +0 -431
- data/doc/created.rid +0 -1
- data/doc/files/LICENSE_txt.html +0 -129
- data/doc/files/README_txt.html +0 -209
- data/doc/files/lib/stella/adapter/ab_rb.html +0 -101
- data/doc/files/lib/stella/adapter/base_rb.html +0 -101
- data/doc/files/lib/stella/adapter/httperf_rb.html +0 -101
- data/doc/files/lib/stella/adapter/siege_rb.html +0 -101
- data/doc/files/lib/stella/cli/base_rb.html +0 -101
- data/doc/files/lib/stella/cli/language_rb.html +0 -101
- data/doc/files/lib/stella/cli/localtest_rb.html +0 -101
- data/doc/files/lib/stella/cli_rb.html +0 -112
- data/doc/files/lib/stella/command/base_rb.html +0 -101
- data/doc/files/lib/stella/command/localtest_rb.html +0 -101
- data/doc/files/lib/stella/logger_rb.html +0 -101
- data/doc/files/lib/stella/response_rb.html +0 -101
- data/doc/files/lib/stella/storable_rb.html +0 -109
- data/doc/files/lib/stella/support_rb.html +0 -101
- data/doc/files/lib/stella/test/daysummary_rb.html +0 -101
- data/doc/files/lib/stella/test/definition_rb.html +0 -101
- data/doc/files/lib/stella/test/runsummary_rb.html +0 -101
- data/doc/files/lib/stella/test/summarybase_rb.html +0 -101
- data/doc/files/lib/stella/test/testsummary_rb.html +0 -108
- data/doc/files/lib/stella/text/resource_rb.html +0 -108
- data/doc/files/lib/stella/text_rb.html +0 -108
- data/doc/files/lib/stella_rb.html +0 -128
- data/doc/files/lib/utils/crypto-key_rb.html +0 -116
- data/doc/files/lib/utils/fileutil_rb.html +0 -108
- data/doc/files/lib/utils/httputil_rb.html +0 -110
- data/doc/files/lib/utils/mathutil_rb.html +0 -101
- data/doc/files/lib/utils/textgraph_rb.html +0 -138
- data/doc/files/lib/utils/timerutil_rb.html +0 -108
- data/doc/fr_class_index.html +0 -66
- data/doc/fr_file_index.html +0 -62
- data/doc/fr_method_index.html +0 -309
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/stella/test/daysummary.rb +0 -93
- data/spec/base.rb +0 -26
- data/spec/shell_spec.rb +0 -12
data/lib/stella/cli.rb
CHANGED
@@ -2,13 +2,14 @@
|
|
2
2
|
require 'optparse'
|
3
3
|
require 'ostruct'
|
4
4
|
|
5
|
-
# All command-line interface wrappers
|
6
5
|
require 'stella/cli/base'
|
7
|
-
require 'stella/cli/language'
|
8
|
-
require 'stella/cli/localtest'
|
9
6
|
|
10
7
|
module Stella
|
11
8
|
|
9
|
+
# Stella::Config
|
10
|
+
#
|
11
|
+
# This Config class manages the content of ENV['HOME]/.stella. The functionality
|
12
|
+
# is currently disabled so stella is stateless.
|
12
13
|
class Config < Storable
|
13
14
|
DEFAULT_HOME = File.join(ENV['HOME'], '.stella').freeze unless defined? DEFAULT_HOME
|
14
15
|
DEFAULT_DATA_HOME = File.join(Dir.getwd, 'stella').freeze unless defined? DEFAULT_DATA_HOME
|
@@ -42,27 +43,36 @@ module Stella
|
|
42
43
|
|
43
44
|
end
|
44
45
|
|
45
|
-
|
46
|
+
# Stella::CLI
|
47
|
+
#
|
48
|
+
# The is the front-end class for the command-line implementation. The stella script
|
49
|
+
# creates an instance of this class which is the glue between the command-line
|
50
|
+
# and the Stella command classes.
|
51
|
+
# Note: All Stella::CLI classes are autoloaded and they add themselves to @@commands.
|
46
52
|
class CLI
|
47
53
|
|
54
|
+
# Auto populated with 'command' => Stella::CLI::[class] by each cli class on 'require'.
|
55
|
+
@@commands = {}
|
56
|
+
|
48
57
|
attr_reader :options
|
49
58
|
attr_reader :logger
|
50
|
-
|
59
|
+
|
51
60
|
|
61
|
+
|
52
62
|
def initialize(arguments=[], stdin=nil)
|
53
63
|
@arguments = arguments
|
54
64
|
@stdin = stdin
|
55
65
|
|
56
|
-
@commands = {
|
57
|
-
'ab' => Stella::CLI::LocalTest,
|
58
|
-
'siege' => Stella::CLI::LocalTest,
|
59
|
-
'httperf' => Stella::CLI::LocalTest,
|
60
|
-
'lang' => Stella::CLI::Language
|
61
|
-
}
|
62
66
|
@config = Stella::Config.new
|
63
67
|
@options = OpenStruct.new
|
64
68
|
@options.verbose = 0
|
69
|
+
@options.data_path = @config.working_directory
|
65
70
|
@options.agents = []
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def commands
|
75
|
+
@@commands
|
66
76
|
end
|
67
77
|
|
68
78
|
def run
|
@@ -76,13 +86,13 @@ module Stella
|
|
76
86
|
|
77
87
|
# Pull the requested command object out of the list
|
78
88
|
# and tell it what shortname that was used to call it.
|
79
|
-
command =
|
89
|
+
command = @@commands[@command_name].new(@command_name)
|
80
90
|
|
81
91
|
# Give the command object access to the config and runtime options
|
82
92
|
#command.global_config = @config
|
83
93
|
command.stella_options = @options
|
84
94
|
command.arguments = @command_arguments
|
85
|
-
command.working_directory = @
|
95
|
+
command.working_directory = @options.data_path
|
86
96
|
|
87
97
|
command.run
|
88
98
|
|
@@ -104,7 +114,7 @@ module Stella
|
|
104
114
|
|
105
115
|
@command_name = nil
|
106
116
|
@arguments.each do |arg|
|
107
|
-
if (
|
117
|
+
if (@@commands.has_key? arg)
|
108
118
|
@command_name = arg
|
109
119
|
index = @arguments.index(@command_name)
|
110
120
|
@command_arguments = @arguments[index + 1..@arguments.size]
|
@@ -133,7 +143,7 @@ module Stella
|
|
133
143
|
|
134
144
|
opts = OptionParser.new
|
135
145
|
opts.banner = Stella::TEXT.msg(:option_help_usage)
|
136
|
-
opts.on Stella::TEXT.msg(:option_help_preamble,
|
146
|
+
opts.on Stella::TEXT.msg(:option_help_preamble, @@commands.keys.join(', '))
|
137
147
|
|
138
148
|
opts.on(Stella::TEXT.msg(:option_help_options_title))
|
139
149
|
opts.on('-V', '--version', Stella::TEXT.msg(:option_help_version)) do
|
@@ -149,9 +159,13 @@ module Stella
|
|
149
159
|
opts.on('-q', '--quiet', Stella::TEXT.msg(:option_help_quiet)) do
|
150
160
|
@options.quiet = true
|
151
161
|
end
|
152
|
-
|
153
|
-
|
154
|
-
|
162
|
+
|
163
|
+
# Overhead is interesting for development and auditing but we're not
|
164
|
+
# currently tracking this. It needed to be re-implemented from scratch
|
165
|
+
# so we'll redo this soon. It's also useful for comparing Ruby/JRuby/IronRuby
|
166
|
+
#opts.on('--overhead', String, Stella::TEXT.msg(:option_help_overhead)) do
|
167
|
+
# @options.showoverhead = true
|
168
|
+
#end
|
155
169
|
|
156
170
|
opts.on('-O', '--stdout', Stella::TEXT.msg(:option_help_stdout)) do
|
157
171
|
@options.stdout = true
|
@@ -183,10 +197,9 @@ module Stella
|
|
183
197
|
@options.warmup = MathUtil.enforce_limit(((v) ? v : 0), 0.1, 1)
|
184
198
|
end
|
185
199
|
|
186
|
-
opts.on('-a', '--agent=S', String, Stella::TEXT.msg(:option_help_agent)) do |v|
|
187
|
-
raise "Agent is empty" if v.empty?
|
200
|
+
opts.on('-a', '--agent=[S]', String, Stella::TEXT.msg(:option_help_agent)) do |v|
|
188
201
|
@options.agents ||= []
|
189
|
-
agent_ary = Stella::Util::expand_str(v)
|
202
|
+
agent_ary = Stella::Util::expand_str(v || 'random')
|
190
203
|
@options.agents.push(agent_ary)
|
191
204
|
end
|
192
205
|
|
@@ -248,7 +261,7 @@ module Stella
|
|
248
261
|
# Stella::LOGGER.debug("ENV[#{n}]=#{v}")
|
249
262
|
#end
|
250
263
|
|
251
|
-
Stella::LOGGER.debug("Commands (#{@command_name}): #{
|
264
|
+
Stella::LOGGER.debug("Commands (#{@command_name}): #{@@commands.keys.join(',')}")
|
252
265
|
|
253
266
|
#Stella::LOGGER.debug("Configs: ")
|
254
267
|
#@config.to_hash.each_pair do |n,v|
|
@@ -265,4 +278,14 @@ module Stella
|
|
265
278
|
Stella::LOGGER.debug("Command Arguments: #{@command_arguments.join(',')}" )
|
266
279
|
end
|
267
280
|
end
|
281
|
+
end
|
282
|
+
|
283
|
+
# Autoload CLI classes. These classes add themselves to the class variable @@commands.
|
284
|
+
begin
|
285
|
+
cli_classes = Dir.glob(File.join(STELLA_HOME, 'lib', 'stella', 'cli', "*.rb"))
|
286
|
+
cli_classes.each do |path|
|
287
|
+
require path
|
288
|
+
end
|
289
|
+
rescue LoadError => ex
|
290
|
+
Stella::LOGGER.info("Error loading #{path}: #{ex.message}")
|
268
291
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
module Stella
|
5
|
+
class CLI
|
6
|
+
|
7
|
+
class Agents < Stella::CLI::Base
|
8
|
+
|
9
|
+
attr_accessor :full
|
10
|
+
attr_accessor :list
|
11
|
+
attr_accessor :search
|
12
|
+
attr_accessor :help
|
13
|
+
|
14
|
+
def initialize(adapter)
|
15
|
+
super(adapter)
|
16
|
+
@full = false
|
17
|
+
@list = false
|
18
|
+
@help = false
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
process_options
|
23
|
+
|
24
|
+
if @help
|
25
|
+
process_options(:display)
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
29
|
+
# The LocalTest command is the keeper of the user agents
|
30
|
+
localtest = Stella::LocalTest.new
|
31
|
+
|
32
|
+
agents = []
|
33
|
+
all_agents = localtest.available_agents
|
34
|
+
all_agents.each_pair do |key,value|
|
35
|
+
if (@full)
|
36
|
+
value.each do |full_value|
|
37
|
+
agent = full_value.join(' ')
|
38
|
+
agents << agent if (!@search || agent.to_s.match(/#{search}/i))
|
39
|
+
end
|
40
|
+
else
|
41
|
+
agents << key.to_s if (!@search || key.to_s.match(/#{search}/i))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
puts (@list) ? agents.uniq.sort.join("\n") : Stella::TEXT.msg(:agents_count_message, agents.uniq.size)
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def process_options(display=false)
|
50
|
+
|
51
|
+
opts = OptionParser.new
|
52
|
+
opts.banner = Stella::TEXT.msg(:option_help_usage)
|
53
|
+
opts.on('-h', '--help', Stella::TEXT.msg(:option_help_help)) { @help = true }
|
54
|
+
opts.on('-f', '--full', Stella::TEXT.msg(:agents_option_full)) { @full = true }
|
55
|
+
opts.on('-l', '--list', Stella::TEXT.msg(:agents_option_list)) { @list = true }
|
56
|
+
# TODO: display agents based on shortnames. This is important to maintain continuity with the stella option.
|
57
|
+
#opts.on('-a', '--agent', Stella::TEXT.msg(:agents_option_list)) { @list = true }
|
58
|
+
opts.on('-s', '--search=S', String, Stella::TEXT.msg(:agents_option_search)) { |v| @search = v }
|
59
|
+
|
60
|
+
opts.parse!(@arguments)
|
61
|
+
|
62
|
+
if display
|
63
|
+
Stella::LOGGER.info opts
|
64
|
+
return
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
@@commands['agents'] = Stella::CLI::Agents
|
72
|
+
end
|
73
|
+
end
|
data/lib/stella/cli/language.rb
CHANGED
data/lib/stella/cli/localtest.rb
CHANGED
data/lib/stella/command/base.rb
CHANGED
@@ -27,6 +27,7 @@ module Stella
|
|
27
27
|
attr_reader :paths
|
28
28
|
|
29
29
|
attr_accessor :working_directory
|
30
|
+
attr_reader :available_agents
|
30
31
|
|
31
32
|
def initialize(testdef=nil, adapter=nil)
|
32
33
|
@testdef = testdef if testdef
|
@@ -73,18 +74,16 @@ module Stella
|
|
73
74
|
|
74
75
|
test_path = _generate_test_path
|
75
76
|
|
76
|
-
|
77
77
|
prepare_test(test_path)
|
78
78
|
|
79
79
|
threshold = (@testdef.rampup) ? @testdef.rampup.ceiling : @adapter.vusers
|
80
80
|
|
81
|
-
|
82
81
|
runnum = "00"
|
83
82
|
while(@adapter.vusers <= threshold) do
|
84
83
|
|
85
84
|
# Make sure the load factor is set to 1. If there was a warmup,
|
86
85
|
# then this value will be less than 1.
|
87
|
-
testrun =
|
86
|
+
testrun = maker_of_testruns(1)
|
88
87
|
|
89
88
|
# We empty test_runpaths so we can keep track of the runpaths for each
|
90
89
|
# level of virtual users. This is useful during a rampup test so we can
|
@@ -117,7 +116,7 @@ module Stella
|
|
117
116
|
if @testdef.sleep && @testdef.sleep.to_f > 0 && @testdef.repetitions > 1
|
118
117
|
run_sleeper(@testdef.sleep)
|
119
118
|
end
|
120
|
-
Stella::LOGGER.info('') # We want the newline
|
119
|
+
Stella::LOGGER.info('') unless @quiet # We want the newline
|
121
120
|
end
|
122
121
|
|
123
122
|
# Rampup tests produce multiple summary files which include the batch
|
@@ -146,7 +145,7 @@ module Stella
|
|
146
145
|
|
147
146
|
|
148
147
|
# Non-rampup tests only need to run through the loop once.
|
149
|
-
break if (@adapter.vusers == threshold)
|
148
|
+
break if (!@testdef.rampup && @adapter.vusers == threshold)
|
150
149
|
|
151
150
|
end
|
152
151
|
|
@@ -167,14 +166,66 @@ module Stella
|
|
167
166
|
|
168
167
|
private
|
169
168
|
|
170
|
-
#
|
169
|
+
# prepare_test
|
170
|
+
#
|
171
|
+
# Execute the group of testruns associated to this test. This includes
|
172
|
+
# zero or one warmup and one or more testruns.
|
173
|
+
#
|
174
|
+
# INPUT:
|
175
|
+
# +test_path+ filesystem path to store all test data
|
176
|
+
#
|
177
|
+
def prepare_test(test_path)
|
178
|
+
|
179
|
+
Stella::LOGGER.info("Writing test data to: #{test_path}\n\n") unless @quiet
|
180
|
+
|
181
|
+
# Make sure the test storage directory is created along with the
|
182
|
+
# latest symlink
|
183
|
+
FileUtil.create_dir(test_path)
|
184
|
+
File.unlink(latest_test_symlink_path) if File.exists?(latest_test_symlink_path)
|
185
|
+
File.symlink(File.expand_path(test_path), latest_test_symlink_path)
|
186
|
+
|
187
|
+
# Write the test ID to the storage directory
|
188
|
+
FileUtil.write_file(test_path + "/ID.txt", @guid, true)
|
189
|
+
|
190
|
+
# And the test run message
|
191
|
+
FileUtil.write_file(test_path + "/MESSAGE.txt", @testdef.message, true) if @testdef.message
|
192
|
+
|
193
|
+
@adapter.user_agent = @agents unless @agents.empty?
|
194
|
+
|
195
|
+
# The warmup is identical to a testrun except for two things:
|
196
|
+
# - we don't make note of the runpath
|
197
|
+
# - there is a one second sleep after the run.
|
198
|
+
# Everything else is identical.
|
199
|
+
if @testdef.warmup
|
200
|
+
|
201
|
+
testrun = maker_of_testruns(@testdef.warmup)
|
202
|
+
|
203
|
+
# Generate the filesystem path to store the run data.
|
204
|
+
# NOTE: We don't keep the warmup path in @test_runpaths because we
|
205
|
+
# include it in the final calculation for the test.
|
206
|
+
runpath = File.join(test_path, "warmup")
|
207
|
+
|
208
|
+
# Run the warmpup round
|
209
|
+
testrun.call("Warmup", runpath)
|
210
|
+
|
211
|
+
run_sleeper(@testdef.sleep || 1)
|
212
|
+
|
213
|
+
Stella::LOGGER.info('', '') unless @quiet # We just need the newline
|
214
|
+
|
215
|
+
end
|
216
|
+
|
217
|
+
print_title unless @quiet
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
# maker_of_testruns
|
171
222
|
#
|
172
223
|
# Generator of test runs. Everything that happens during a test
|
173
224
|
# run is defined here. We use a Proc so we can toss the functionality
|
174
225
|
# around like something that's dirty and loves a good tossing.
|
175
226
|
# It's important that all output be on a single line without a
|
176
227
|
# line terminator. Otherwise great descruction could occur.
|
177
|
-
def
|
228
|
+
def maker_of_testruns(factor)
|
178
229
|
testrun = Proc.new do |name,runpath|
|
179
230
|
# Make sure the test run storage directory is created
|
180
231
|
FileUtil.create_dir(runpath)
|
@@ -183,7 +234,7 @@ module Stella
|
|
183
234
|
@adapter.working_directory = runpath
|
184
235
|
@adapter.before
|
185
236
|
|
186
|
-
Stella::LOGGER.info_printf("%
|
237
|
+
Stella::LOGGER.info_printf("%8s: %10d@%-6s ", name, @adapter.requests, @adapter.vuser_rate) unless @quiet
|
187
238
|
|
188
239
|
# Here we record the command arguments. This needs to be last because we modify
|
189
240
|
# some of the arguments above.
|
@@ -202,65 +253,16 @@ module Stella
|
|
202
253
|
|
203
254
|
save_summary(@adapter.summary_path(@format), stats)
|
204
255
|
|
205
|
-
|
256
|
+
|
206
257
|
unless @quiet
|
207
|
-
Stella::LOGGER.info_print(sprintf("%
|
208
|
-
Stella::LOGGER.info_print(sprintf("%
|
209
|
-
Stella::LOGGER.info_print(sprintf(" (ruby: %.4f with %.4f overhead)", run_timer.real, run_timer.overhead)) if @showoverhead
|
258
|
+
Stella::LOGGER.info_print(sprintf("%3.0f%% %9.2f/s %8.3fs ", stats.availability, stats.transaction_rate, stats.response_time))
|
259
|
+
Stella::LOGGER.info_print(sprintf("%8.3fMB/s %8.3fMB %8.3fs ", stats.throughput, stats.data_transferred, stats.elapsed_time))
|
210
260
|
# NOTE: We don't print a line terminator here
|
211
261
|
end
|
212
262
|
|
213
263
|
end
|
214
264
|
end
|
215
265
|
|
216
|
-
|
217
|
-
# prepare_test
|
218
|
-
#
|
219
|
-
# Execute the group of testruns associated to this test. This includes
|
220
|
-
# zero or one warmup and one or more testruns.
|
221
|
-
#
|
222
|
-
# INPUT:
|
223
|
-
# +test_path+ filesystem path to store all test data
|
224
|
-
#
|
225
|
-
def prepare_test(test_path)
|
226
|
-
|
227
|
-
Stella::LOGGER.info("Writing test data to: #{test_path}\n\n") unless @quiet
|
228
|
-
|
229
|
-
# Make sure the test storage directory is created along with the
|
230
|
-
# latest symlink
|
231
|
-
FileUtil.create_dir(test_path)
|
232
|
-
File.unlink(latest_test_symlink_path) if File.exists?(latest_test_symlink_path)
|
233
|
-
File.symlink(File.expand_path(test_path), latest_test_symlink_path)
|
234
|
-
|
235
|
-
# Write the test ID to the storage directory
|
236
|
-
FileUtil.write_file(test_path + "/ID.txt", @guid, true)
|
237
|
-
|
238
|
-
# And the test run message
|
239
|
-
FileUtil.write_file(test_path + "/MESSAGE.txt", @testdef.message, true) if @testdef.message
|
240
|
-
|
241
|
-
# The warmup is identical to a testrun except for two things:
|
242
|
-
# - we don't make note of the runpath
|
243
|
-
# - there is a one second sleep after the run.
|
244
|
-
# Everything else is identical.
|
245
|
-
if @testdef.warmup
|
246
|
-
|
247
|
-
testrun = testrun_maker(@testdef.warmup)
|
248
|
-
|
249
|
-
# Generate the filesystem path to store the run data.
|
250
|
-
# NOTE: We don't keep the warmup path in @test_runpaths because we
|
251
|
-
# include it in the final calculation for the test.
|
252
|
-
runpath = File.join(test_path, "warmup")
|
253
|
-
|
254
|
-
# Run the warmpup round
|
255
|
-
testrun.call("Warmup", runpath)
|
256
|
-
|
257
|
-
run_sleeper(@testdef.sleep || 1)
|
258
|
-
|
259
|
-
Stella::LOGGER.info('', '') # We just need the newline
|
260
|
-
end
|
261
|
-
|
262
|
-
|
263
|
-
end
|
264
266
|
|
265
267
|
# print_summary
|
266
268
|
#
|
@@ -268,13 +270,27 @@ module Stella
|
|
268
270
|
# it's also called at the end of all the runs.
|
269
271
|
#
|
270
272
|
# INPUT:
|
271
|
-
# stats:: Any object that extends Stella::Test::
|
273
|
+
# stats:: Any object that extends Stella::Test::Base object
|
272
274
|
def print_summary(stats)
|
273
275
|
Stella::LOGGER.info(' ' << "-"*67) unless @quiet
|
274
276
|
|
275
|
-
Stella::LOGGER.
|
276
|
-
Stella::LOGGER.info_printf("%
|
277
|
-
Stella::LOGGER.
|
277
|
+
Stella::LOGGER.info_printf("%8s: %10d@%-6d% 3.0f%% %9.2f/s ", "Total", stats.transactions_total, stats.vusers_avg, stats.availability, stats.transaction_rate_avg)
|
278
|
+
Stella::LOGGER.info_printf("%8.3fs %8.3fMB/s %8.3fMB %8.3fs", stats.response_time_avg, stats.throughput_avg, stats.data_transferred_total, stats.elapsed_time_total)
|
279
|
+
Stella::LOGGER.info('') # New line
|
280
|
+
Stella::LOGGER.info_printf("%8s: %22s %9.2f/s %8.3fs %8.3fMB/s %10s %8.3fs", "Std Dev", '', stats.transaction_rate_sdev, stats.response_time_sdev, stats.throughput_sdev, '', stats.elapsed_time_sdev)
|
281
|
+
Stella::LOGGER.info('') # New line
|
282
|
+
Stella::LOGGER.info('') unless @quiet # Extra new line
|
283
|
+
end
|
284
|
+
|
285
|
+
# print_title
|
286
|
+
#
|
287
|
+
# Prints the column headers for the test run output. Field widths match those
|
288
|
+
# in print_summary and test_maker
|
289
|
+
def print_title
|
290
|
+
Stella::LOGGER.info(' ' << "-"*67) unless @quiet
|
291
|
+
|
292
|
+
Stella::LOGGER.info_printf("%8s %10s@%-5s %5s %11s", "", 'REQ', 'VU/s', 'AVAIL', 'REQ/s')
|
293
|
+
Stella::LOGGER.info_printf("%10s %12s %10s %9s", 'RTIME', 'DATA/s', 'DATA', 'TIME')
|
278
294
|
Stella::LOGGER.info('') # New line
|
279
295
|
Stella::LOGGER.info('') unless @quiet # Extra new line
|
280
296
|
end
|
@@ -285,7 +301,7 @@ module Stella
|
|
285
301
|
#
|
286
302
|
# INPUT:
|
287
303
|
# filepath:: the complete path for the file (string)
|
288
|
-
# stats:: Any object that extends Stella::Test::
|
304
|
+
# stats:: Any object that extends Stella::Test::Base object
|
289
305
|
def save_summary(filepath, stats)
|
290
306
|
FileUtil.write_file(filepath, stats.dump(@format, :with_titles), true)
|
291
307
|
end
|
@@ -293,12 +309,12 @@ module Stella
|
|
293
309
|
# Load SUMMARY file for each run and create a summary with
|
294
310
|
# totals, averages, and standard deviations.
|
295
311
|
def process_test_stats(paths)
|
296
|
-
test_stats = Stella::Test::
|
312
|
+
test_stats = Stella::Test::Summary.new(@message)
|
297
313
|
all_stats_obj = []
|
298
314
|
paths.each do |path|
|
299
315
|
file_contents = FileUtil.read_file_to_array("#{path}/SUMMARY.#{@format}")
|
300
|
-
stats = Stella::Test::
|
301
|
-
stats_obj = Stella::Test::
|
316
|
+
stats = Stella::Test::Run::Summary.undump(@format, file_contents)
|
317
|
+
stats_obj = Stella::Test::Run::Summary.from_hash(stats)
|
302
318
|
test_stats.add_run(stats_obj)
|
303
319
|
end
|
304
320
|
|