Class: Cloudscale::Benchmark::BenchmarkRun
- Inherits:
-
Object
- Object
- Cloudscale::Benchmark::BenchmarkRun
- Includes:
- Hashable
- Defined in:
- lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb
Instance Attribute Summary collapse
-
#batchName ⇒ Object
Returns the value of attribute batchName.
-
#benchmarkInstance ⇒ Object
Returns the value of attribute benchmarkInstance.
-
#benchmarkTest ⇒ Object
Returns the value of attribute benchmarkTest.
-
#benchmarkTestSuite ⇒ Object
Returns the value of attribute benchmarkTestSuite.
-
#id ⇒ Object
Returns the value of attribute id.
-
#scheduled ⇒ Object
Returns the value of attribute scheduled.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#started ⇒ Object
Returns the value of attribute started.
-
#status ⇒ Object
Returns the value of attribute status.
-
#statusMessage ⇒ Object
Returns the value of attribute statusMessage.
-
#stopped ⇒ Object
Returns the value of attribute stopped.
Instance Method Summary collapse
- #failed!(msg) ⇒ Object
- #get_status_hash ⇒ Object
-
#initialize(h) ⇒ BenchmarkRun
constructor
A new instance of BenchmarkRun.
- #no_result!(msg) ⇒ Object
- #running!(msg) ⇒ Object
- #succeed!(msg) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(h) ⇒ BenchmarkRun
Returns a new instance of BenchmarkRun.
15 16 17 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 15 def initialize(h) h.each {|k,v| instance_variable_set("@#{k}",v)} end |
Instance Attribute Details
#batchName ⇒ Object
Returns the value of attribute batchName.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def batchName @batchName end |
#benchmarkInstance ⇒ Object
Returns the value of attribute benchmarkInstance.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def benchmarkInstance @benchmarkInstance end |
#benchmarkTest ⇒ Object
Returns the value of attribute benchmarkTest.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def benchmarkTest @benchmarkTest end |
#benchmarkTestSuite ⇒ Object
Returns the value of attribute benchmarkTestSuite.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def benchmarkTestSuite @benchmarkTestSuite end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def id @id end |
#scheduled ⇒ Object
Returns the value of attribute scheduled.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def scheduled @scheduled end |
#sequence ⇒ Object
Returns the value of attribute sequence.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def sequence @sequence end |
#started ⇒ Object
Returns the value of attribute started.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def started @started end |
#status ⇒ Object
Returns the value of attribute status.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def status @status end |
#statusMessage ⇒ Object
Returns the value of attribute statusMessage.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def statusMessage @statusMessage end |
#stopped ⇒ Object
Returns the value of attribute stopped.
13 14 15 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 13 def stopped @stopped end |
Instance Method Details
#failed!(msg) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 42 def failed!(msg) @status = "failed" if (msg) @statusMessage = msg end @stopped = Time.now.utc.to_s end |
#get_status_hash ⇒ Object
58 59 60 61 62 63 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 58 def get_status_hash hash = {} hash["status"] = @status hash["statusMessage"] = @statusMessage hash end |
#no_result!(msg) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 50 def no_result!(msg) @status = "no results" if (msg) @statusMessage = msg end @stopped = Time.now.utc.to_s end |
#running!(msg) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 26 def running!(msg) @status = "running" if (msg) @statusMessage = msg end @started = Time.now.utc.to_s end |
#succeed!(msg) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 34 def succeed!(msg) @status = "succeeded" if (msg) @statusMessage = msg end @stopped = Time.now.utc.to_s end |
#to_h ⇒ Object
19 20 21 22 23 |
# File 'lib/cloudscale/benchmark/model/benchmark/benchmark_run.rb', line 19 def to_h hash = {} instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } return hash end |