Class: Crusher::CrushSession
- Inherits:
-
Object
- Object
- Crusher::CrushSession
- Defined in:
- lib/crusher/crush_session.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#scenario ⇒ Object
readonly
Returns the value of attribute scenario.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(target, scenario, options = {}) ⇒ CrushSession
constructor
A new instance of CrushSession.
- #log(message) ⇒ Object
Constructor Details
#initialize(target, scenario, options = {}) ⇒ CrushSession
Returns a new instance of CrushSession.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/crusher/crush_session.rb', line 6 def initialize(target, scenario, = {}) @target = target @scenario = scenario @queued_jobs = [] @running_jobs = [] @options = @current_phase = "booting" @scenario.launch_jobs.each do |job| job_id = 0 puts job.keys.inspect puts "Launching #{job[:count]} #{job[:type]}(s)..." job[:count].times do queue_job(job, job_id) job_id += 1 end end launch_queued_jobs end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/crusher/crush_session.rb', line 4 def logger @logger end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
4 5 6 |
# File 'lib/crusher/crush_session.rb', line 4 def scenario @scenario end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
4 5 6 |
# File 'lib/crusher/crush_session.rb', line 4 def target @target end |
Instance Method Details
#log(message) ⇒ Object
28 29 30 31 32 |
# File 'lib/crusher/crush_session.rb', line 28 def log() = @current_phase + ' ' + @logger.info nil end |