Skip to content

Commit

Permalink
Change to efficiency reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Feb 1, 2024
1 parent a46ff1c commit ddf58cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions lib/mutant/reporter/cli/printer/env_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class EnvProgress < self
:coverage,
:env,
:killtime,
:overhead,
:runtime
)

Expand All @@ -25,7 +24,7 @@ class EnvProgress < self
[:info, 'Timeouts: %s', :amount_timeouts ],
[:info, 'Runtime: %0.2fs', :runtime ],
[:info, 'Killtime: %0.2fs', :killtime ],
[:info, 'Overhead: %0.2f%%', :overhead_percent ],
[:info, 'Efficiency: %0.2f%%', :efficiency_percent ],
[:info, 'Mutations/s: %0.2f', :mutations_per_second ],
[:status, 'Coverage: %0.2f%%', :coverage_percent ]
].each(&:freeze)
Expand All @@ -50,8 +49,8 @@ def coverage_percent
coverage * 100
end

def overhead_percent
(overhead / killtime) * 100
def efficiency_percent
(killtime / runtime) * 100
end
end # EnvProgress
end # Printer
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 0.00s
Overhead: Inf%
Efficiency: 0.00%
Mutations/s: 0.00
Coverage: 100.00%
STR
Expand All @@ -56,7 +56,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 100.00%
STR
Expand Down Expand Up @@ -85,7 +85,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 50.00%
STR
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/mutant/reporter/cli/printer/env_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 50.00%
STR
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/mutant/reporter/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def self.it_reports(expected_content)
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 100.00%
REPORT
Expand Down

0 comments on commit ddf58cb

Please sign in to comment.