Class: Evilution::Result::Summary Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_mutationsObject (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

#durationObject (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

#resultsObject (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

#skippedObject (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_gapsObject

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

#efficiencyObject

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

#equivalentObject

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_resultsObject

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

#errorsObject

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

#killedObject

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_resultsObject

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

#killtimeObject

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_secondObject

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

#neutralObject

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_resultsObject

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_mbObject

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

#scoreObject

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_denominatorObject

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.

Returns:

  • (Boolean)


69
70
71
# File 'lib/evilution/result/summary.rb', line 69

def success?(min_score: 1.0)
  score >= min_score
end

#survivedObject

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_resultsObject

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_outObject

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

#totalObject

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.

Returns:

  • (Boolean)


18
19
20
# File 'lib/evilution/result/summary.rb', line 18

def truncated?
  @truncated
end

#unparseableObject

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_resultsObject

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

#unresolvedObject

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_resultsObject

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