Class: DeepTest::Distributed::ThroughputStatistics
- Inherits:
-
Object
- Object
- DeepTest::Distributed::ThroughputStatistics
- Defined in:
- lib/deep_test/distributed/throughput_statistics.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#test_count ⇒ Object
readonly
Returns the value of attribute test_count.
Instance Method Summary collapse
-
#initialize(test_count, start_time, end_time) ⇒ ThroughputStatistics
constructor
A new instance of ThroughputStatistics.
- #summary ⇒ Object
- #tests_per_second ⇒ Object
- #timespan_in_seconds ⇒ Object
Constructor Details
#initialize(test_count, start_time, end_time) ⇒ ThroughputStatistics
Returns a new instance of ThroughputStatistics.
6 7 8 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 6 def initialize(test_count, start_time, end_time) @test_count, @start_time, @end_time = test_count, start_time, end_time end |
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
4 5 6 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 4 def end_time @end_time end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 4 def start_time @start_time end |
#test_count ⇒ Object (readonly)
Returns the value of attribute test_count.
4 5 6 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 4 def test_count @test_count end |
Instance Method Details
#summary ⇒ Object
18 19 20 21 22 23 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 18 def summary <<-end_summary #{test_count} tests run in #{timespan_in_seconds} seconds (#{tests_per_second} tests / second) end_summary end |
#tests_per_second ⇒ Object
14 15 16 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 14 def tests_per_second @test_count / timespan_in_seconds end |
#timespan_in_seconds ⇒ Object
10 11 12 |
# File 'lib/deep_test/distributed/throughput_statistics.rb', line 10 def timespan_in_seconds @end_time.to_f - @start_time.to_f end |