Class: Evilution::Result::Summary Private
- Inherits:
-
Object
- Object
- Evilution::Result::Summary
- Defined in:
- lib/evilution/result/summary.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #disabled_mutations ⇒ Object readonly private
- #duration ⇒ Object readonly private
- #results ⇒ Object readonly private
- #skipped ⇒ Object readonly private
Instance Method Summary collapse
- #coverage_gaps ⇒ Object private
- #efficiency ⇒ Object private
- #equivalent ⇒ Object private
- #equivalent_results ⇒ Object private
- #errors ⇒ Object private
-
#initialize(results:, duration: 0.0, truncated: false, skipped: 0, disabled_mutations: []) ⇒ Summary
constructor
private
A new instance of Summary.
- #killed ⇒ Object private
- #killed_results ⇒ Object private
- #killtime ⇒ Object private
- #mutations_per_second ⇒ Object private
- #neutral ⇒ Object private
- #neutral_results ⇒ Object private
- #peak_memory_mb ⇒ Object private
- #score ⇒ Object private
- #score_denominator ⇒ Object private
- #success?(min_score: 1.0) ⇒ Boolean private
- #survived ⇒ Object private
- #survived_results ⇒ Object private
- #timed_out ⇒ Object private
- #total ⇒ Object private
- #truncated? ⇒ Boolean private
- #unparseable ⇒ Object private
- #unparseable_results ⇒ Object private
- #unresolved ⇒ Object private
- #unresolved_results ⇒ Object private
Constructor Details
#initialize(results:, duration: 0.0, truncated: false, skipped: 0, disabled_mutations: []) ⇒ Summary
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.
Returns a new instance of Summary.
9 10 11 12 13 14 15 16 |
# File 'lib/evilution/result/summary.rb', line 9 def initialize(results:, duration: 0.0, truncated: false, skipped: 0, disabled_mutations: []) @results = results @duration = duration @truncated = truncated @skipped = skipped @disabled_mutations = disabled_mutations freeze end |
Instance Attribute Details
#disabled_mutations ⇒ Object (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.
7 8 9 |
# File 'lib/evilution/result/summary.rb', line 7 def disabled_mutations @disabled_mutations end |
#duration ⇒ Object (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.
7 8 9 |
# File 'lib/evilution/result/summary.rb', line 7 def duration @duration end |
#results ⇒ Object (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.
7 8 9 |
# File 'lib/evilution/result/summary.rb', line 7 def results @results end |
#skipped ⇒ Object (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.
7 8 9 |
# File 'lib/evilution/result/summary.rb', line 7 def skipped @skipped end |
Instance Method Details
#coverage_gaps ⇒ Object
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.
97 98 99 |
# File 'lib/evilution/result/summary.rb', line 97 def coverage_gaps Evilution::Result::CoverageGapGrouper.new.call(survived_results) end |
#efficiency ⇒ Object
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.
105 106 107 108 109 |
# File 'lib/evilution/result/summary.rb', line 105 def efficiency return 0.0 if duration.zero? killtime / duration end |
#equivalent ⇒ Object
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.
46 47 48 |
# File 'lib/evilution/result/summary.rb', line 46 def equivalent results.count(&:equivalent?) end |
#equivalent_results ⇒ Object
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.
85 86 87 |
# File 'lib/evilution/result/summary.rb', line 85 def equivalent_results results.select(&:equivalent?) end |
#errors ⇒ Object
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.
38 39 40 |
# File 'lib/evilution/result/summary.rb', line 38 def errors results.count(&:error?) end |
#killed ⇒ Object
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.
26 27 28 |
# File 'lib/evilution/result/summary.rb', line 26 def killed results.count(&:killed?) end |
#killed_results ⇒ Object
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.
77 78 79 |
# File 'lib/evilution/result/summary.rb', line 77 def killed_results results.select(&:killed?) end |
#killtime ⇒ Object
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.
101 102 103 |
# File 'lib/evilution/result/summary.rb', line 101 def killtime results.sum(0.0, &:duration) end |
#mutations_per_second ⇒ Object
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.
111 112 113 114 115 |
# File 'lib/evilution/result/summary.rb', line 111 def mutations_per_second return 0.0 if duration.zero? total.to_f / duration end |
#neutral ⇒ Object
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.
42 43 44 |
# File 'lib/evilution/result/summary.rb', line 42 def neutral results.count(&:neutral?) end |
#neutral_results ⇒ Object
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.
81 82 83 |
# File 'lib/evilution/result/summary.rb', line 81 def neutral_results results.select(&:neutral?) end |
#peak_memory_mb ⇒ Object
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.
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/evilution/result/summary.rb', line 117 def peak_memory_mb max_rss = nil results.each do |result| kb = result.child_rss_kb next unless kb max_rss = kb if max_rss.nil? || kb > max_rss end max_rss && (max_rss / 1024.0) end |
#score ⇒ Object
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.
62 63 64 65 66 67 |
# File 'lib/evilution/result/summary.rb', line 62 def score denominator = score_denominator return 0.0 if denominator.zero? killed.to_f / denominator end |
#score_denominator ⇒ Object
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.
58 59 60 |
# File 'lib/evilution/result/summary.rb', line 58 def score_denominator total - errors - neutral - equivalent - unresolved - unparseable end |
#success?(min_score: 1.0) ⇒ Boolean
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.
69 70 71 |
# File 'lib/evilution/result/summary.rb', line 69 def success?(min_score: 1.0) score >= min_score end |
#survived ⇒ Object
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.
30 31 32 |
# File 'lib/evilution/result/summary.rb', line 30 def survived results.count(&:survived?) end |
#survived_results ⇒ Object
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.
73 74 75 |
# File 'lib/evilution/result/summary.rb', line 73 def survived_results results.select(&:survived?) end |
#timed_out ⇒ Object
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.
34 35 36 |
# File 'lib/evilution/result/summary.rb', line 34 def timed_out results.count(&:timeout?) end |
#total ⇒ Object
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.
22 23 24 |
# File 'lib/evilution/result/summary.rb', line 22 def total results.length end |
#truncated? ⇒ Boolean
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.
18 19 20 |
# File 'lib/evilution/result/summary.rb', line 18 def truncated? @truncated end |
#unparseable ⇒ Object
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.
54 55 56 |
# File 'lib/evilution/result/summary.rb', line 54 def unparseable results.count(&:unparseable?) end |
#unparseable_results ⇒ Object
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.
93 94 95 |
# File 'lib/evilution/result/summary.rb', line 93 def unparseable_results results.select(&:unparseable?) end |
#unresolved ⇒ Object
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.
50 51 52 |
# File 'lib/evilution/result/summary.rb', line 50 def unresolved results.count(&:unresolved?) end |
#unresolved_results ⇒ Object
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.
89 90 91 |
# File 'lib/evilution/result/summary.rb', line 89 def unresolved_results results.select(&:unresolved?) end |