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
-
#kills ⇒ Fixnum
readonly
private
Return kill count.
-
#mutations ⇒ Fixnum
readonly
private
Return mutation count.
-
#noop_fails ⇒ Fixnum
readonly
private
Return skip count.
-
#subjects ⇒ Fixnum
readonly
private
Return subject count.
-
#time ⇒ Float
readonly
private
Return mutation runtime.
Instance Method Summary collapse
-
#alive ⇒ Fixnum
private
Return number of mutants alive.
-
#initialize ⇒ undefined
constructor
private
Initialize object.
-
#killer(killer) ⇒ self
private
Count killer.
-
#noop_fail(killer) ⇒ self
private
Count noop mutation fail.
-
#runtime ⇒ Float
private
Return runtime in seconds.
-
#subject ⇒ self
private
Count subject.
Constructor Details
#initialize ⇒ undefined
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.
Initialize object
53 54 55 56 |
# File 'lib/mutant/reporter/stats.rb', line 53 def initialize @start = Time.now @noop_fails = @subjects = @mutations = @kills = @time = 0 end |
Instance Attribute Details
#kills ⇒ 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
37 38 39 |
# File 'lib/mutant/reporter/stats.rb', line 37 def kills @kills end |
#mutations ⇒ 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 mutations @mutations end |
#noop_fails ⇒ 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 skip count
29 30 31 |
# File 'lib/mutant/reporter/stats.rb', line 29 def noop_fails @noop_fails end |
#subjects ⇒ 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 subjects @subjects 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
45 46 47 |
# File 'lib/mutant/reporter/stats.rb', line 45 def time @time end |
Instance Method Details
#alive ⇒ Fixnum
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 number of mutants alive
85 86 87 |
# File 'lib/mutant/reporter/stats.rb', line 85 def alive @mutations - @kills end |
#killer(killer) ⇒ self
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.
Count killer
111 112 113 114 115 116 |
# File 'lib/mutant/reporter/stats.rb', line 111 def killer(killer) @mutations +=1 @kills +=1 unless killer.fail? @time += killer.runtime self end |
#noop_fail(killer) ⇒ self
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.
Count noop mutation fail
97 98 99 100 101 |
# File 'lib/mutant/reporter/stats.rb', line 97 def noop_fail(killer) @noop_fails += 1 @time += killer.runtime self end |
#runtime ⇒ Float
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 runtime in seconds
64 65 66 |
# File 'lib/mutant/reporter/stats.rb', line 64 def runtime Time.now - @start end |
#subject ⇒ self
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.
Count subject
74 75 76 77 |
# File 'lib/mutant/reporter/stats.rb', line 74 def subject @subjects +=1 self end |