Class: Mutant::Reporter::Stats
- Inherits:
-
Object
- Object
- Mutant::Reporter::Stats
- Defined in:
- lib/mutant/reporter/stats.rb
Overview
Stats gathered while reporter is running
Instance Attribute Summary collapse
-
#kill ⇒ Fixnum
readonly
private
Return kill count.
-
#mutation ⇒ Fixnum
readonly
private
Return mutation count.
-
#subject ⇒ Fixnum
readonly
private
Return subject count.
-
#time ⇒ Float
readonly
private
Return mutation runtime.
Instance Method Summary collapse
- #alive ⇒ Object
-
#initialize ⇒ Stats
constructor
A new instance of Stats.
- #killer(killer) ⇒ Object
- #runtime ⇒ Object
Constructor Details
#initialize ⇒ Stats
Returns a new instance of Stats.
39 40 41 42 |
# File 'lib/mutant/reporter/stats.rb', line 39 def initialize @start = Time.now @subject = @mutation = @kill = @time = 0 end |
Instance Attribute Details
#kill ⇒ Fixnum (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return kill count
29 30 31 |
# File 'lib/mutant/reporter/stats.rb', line 29 def kill @kill end |
#mutation ⇒ Fixnum (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return mutation count
21 22 23 |
# File 'lib/mutant/reporter/stats.rb', line 21 def mutation @mutation end |
#subject ⇒ Fixnum (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return subject count
13 14 15 |
# File 'lib/mutant/reporter/stats.rb', line 13 def subject @subject end |
#time ⇒ Float (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return mutation runtime
37 38 39 |
# File 'lib/mutant/reporter/stats.rb', line 37 def time @time end |
Instance Method Details
#alive ⇒ Object
52 53 54 |
# File 'lib/mutant/reporter/stats.rb', line 52 def alive @mutation - @kill end |
#killer(killer) ⇒ Object
56 57 58 59 60 |
# File 'lib/mutant/reporter/stats.rb', line 56 def killer(killer) @mutation +=1 @kill +=1 unless killer.fail? @time += killer.runtime end |
#runtime ⇒ Object
44 45 46 |
# File 'lib/mutant/reporter/stats.rb', line 44 def runtime Time.now - @start end |