Class: Mu::Command::Cmd_runscale
- Inherits:
-
Mu::Command
- Object
- Mu::Command
- Mu::Command::Cmd_runscale
- Defined in:
- lib/mu/command/cmd_runscale.rb
Constant Summary
Constants inherited from Mu::Command
Constants included from Helper
Instance Attribute Summary collapse
-
#addr_indexes ⇒ Object
Returns the value of attribute addr_indexes.
-
#api ⇒ Object
Returns the value of attribute api.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#offset_indexes ⇒ Object
Returns the value of attribute offset_indexes.
-
#params ⇒ Object
Returns the value of attribute params.
-
#peak_concurrency ⇒ Object
Returns the value of attribute peak_concurrency.
-
#peak_throughput ⇒ Object
Returns the value of attribute peak_throughput.
Attributes inherited from Mu::Command
Instance Method Summary collapse
-
#cmd_help(argv) ⇒ Object
displays command-line help * argv = command-line arguments.
-
#cmd_run_files(argv) ⇒ Object
sets up, executes, and closes a Studio Scale test for one scenario or each scenario (.msl file) found in the specified directory * argv = command-line arguments * optional -s scenario file * optional -d directory containing one or more scenario files * optional -r argument for recursive directory search (default is a flat directory).
Methods inherited from Mu::Command
Methods included from Helper
#ask, #bin2hex, #error, #escape, #format_float, #get_file_as_string_array, #make_xml, #msg, #shift, #to_boolean
Constructor Details
This class inherits a constructor from Mu::Command
Instance Attribute Details
#addr_indexes ⇒ Object
Returns the value of attribute addr_indexes.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def addr_indexes @addr_indexes end |
#api ⇒ Object
Returns the value of attribute api.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def api @api end |
#hosts ⇒ Object
Returns the value of attribute hosts.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def hosts @hosts end |
#offset_indexes ⇒ Object
Returns the value of attribute offset_indexes.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def offset_indexes @offset_indexes end |
#params ⇒ Object
Returns the value of attribute params.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def params @params end |
#peak_concurrency ⇒ Object
Returns the value of attribute peak_concurrency.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def peak_concurrency @peak_concurrency end |
#peak_throughput ⇒ Object
Returns the value of attribute peak_throughput.
10 11 12 |
# File 'lib/mu/command/cmd_runscale.rb', line 10 def peak_throughput @peak_throughput end |
Instance Method Details
#cmd_help(argv) ⇒ Object
displays command-line help
* argv = command-line arguments
14 15 16 |
# File 'lib/mu/command/cmd_runscale.rb', line 14 def cmd_help argv help end |
#cmd_run_files(argv) ⇒ Object
sets up, executes, and closes a Studio Scale test for one scenario or each scenario (.msl file) found in the specified directory
* argv = command-line arguments
* optional -s scenario file
* optional -d directory containing one or more scenario files
* optional -r argument for recursive directory search (default is a flat directory)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mu/command/cmd_runscale.rb', line 23 def cmd_run_files argv setup argv msg "Clean up existing stats files: app_id_status.json, app_id_stats.csv", Logger::INFO File.delete("app_id_status.json") if File.exists?("app_id_status.json") File.delete("app_id_stats.csv") if File.exists?("app_id_stats.csv") @api = Scale.new(@@mu_ip, @@mu_admin_user, @@mu_admin_pass) @api.configure("pattern", @cmd_line_pattern) @params = {} @params["hosts"] = @cmd_line_hosts if @hash["dir"].nil? files = [@hash["scenario"]] else recursive = (@hash['recursive'].nil?) ? "": "**" files = Dir.glob(File.join(@hash["dir"],recursive,"*.msl")) end if files.nil? or files.empty? msg "no msl files found", Logger::ERROR else files.each do | scenario | begin run scenario rescue Exception => e msg "Run failed: #{e}/nBACKTRACE:#{e.backtrace}", Logger::ERROR end if @verify_only output_verify_results scenario else output_csv scenario end sleep 2 end end @api.release end |