From ddf58cb51eecb99edcd7c0d52ec8195709c20cef Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Thu, 1 Feb 2024 02:15:35 +0000 Subject: [PATCH] Change to efficiency reporting --- lib/mutant/reporter/cli/printer/env_progress.rb | 7 +++---- spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb | 6 +++--- spec/unit/mutant/reporter/cli/printer/env_result_spec.rb | 2 +- spec/unit/mutant/reporter/cli_spec.rb | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/mutant/reporter/cli/printer/env_progress.rb b/lib/mutant/reporter/cli/printer/env_progress.rb index a3e8bf804..d4e3d9cdc 100644 --- a/lib/mutant/reporter/cli/printer/env_progress.rb +++ b/lib/mutant/reporter/cli/printer/env_progress.rb @@ -14,7 +14,6 @@ class EnvProgress < self :coverage, :env, :killtime, - :overhead, :runtime ) @@ -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) @@ -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 diff --git a/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb b/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb index 449b89544..a66a26b0a 100644 --- a/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +++ b/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb @@ -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 @@ -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 @@ -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 diff --git a/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb b/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb index 4ae5cb73e..28ca9e72a 100644 --- a/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +++ b/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb @@ -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 diff --git a/spec/unit/mutant/reporter/cli_spec.rb b/spec/unit/mutant/reporter/cli_spec.rb index 0714456a5..e34a6d493 100644 --- a/spec/unit/mutant/reporter/cli_spec.rb +++ b/spec/unit/mutant/reporter/cli_spec.rb @@ -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