aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'crosperf/experiment_runner.py')
-rw-r--r--crosperf/experiment_runner.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/crosperf/experiment_runner.py b/crosperf/experiment_runner.py
index 1bca6b8c..cb6e9785 100644
--- a/crosperf/experiment_runner.py
+++ b/crosperf/experiment_runner.py
@@ -11,7 +11,7 @@ import os
import shutil
import time
-import afe_lock_machine
+import lock_machine
import test_flag
from cros_utils import command_executer
@@ -129,7 +129,7 @@ class ExperimentRunner(object):
self.locked_machines = self._GetMachineList()
experiment.locked_machines = self.locked_machines
else:
- experiment.lock_mgr = afe_lock_machine.AFELockManager(
+ experiment.lock_mgr = lock_machine.LockManager(
self._GetMachineList(),
'',
experiment.labels[0].chromeos_root,
@@ -282,11 +282,24 @@ class ExperimentRunner(object):
self.l.LogOutput('Storing results of each benchmark run.')
for benchmark_run in experiment.benchmark_runs:
if benchmark_run.result:
- benchmark_run_name = filter(str.isalnum, benchmark_run.name)
+ benchmark_run_name = ''.join(
+ ch for ch in benchmark_run.name if ch.isalnum())
benchmark_run_path = os.path.join(results_directory, benchmark_run_name)
benchmark_run.result.CopyResultsTo(benchmark_run_path)
benchmark_run.result.CleanUp(benchmark_run.benchmark.rm_chroot_tmp)
+ topstats_file = os.path.join(results_directory, 'topstats.log')
+ self.l.LogOutput('Storing top5 statistics of each benchmark run into %s.' %
+ topstats_file)
+ with open(topstats_file, 'w') as top_fd:
+ for benchmark_run in experiment.benchmark_runs:
+ if benchmark_run.result:
+ # Header with benchmark run name.
+ top_fd.write('%s\n' % str(benchmark_run))
+ # Formatted string with top statistics.
+ top_fd.write(benchmark_run.result.FormatStringTop5())
+ top_fd.write('\n\n')
+
def Run(self):
try:
self._Run(self._experiment)