aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_status.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2014-03-11 13:38:07 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-14 19:32:33 +0000
commit139092449a545d4d87c06af3a6d8f3d71e42e927 (patch)
treeede91dc3f94b8062ff60274bd57fca32cf9e8b41 /crosperf/experiment_status.py
parent2317decf0e3f62297fc09a712bdf7fa253d560f3 (diff)
downloadtoolchain-utils-139092449a545d4d87c06af3a6d8f3d71e42e927.tar.gz
Add --logging_level option to crosperf.
Add --logging_level={verbose, average, quiet} option to crosperf, optionally reducing the amount of logging output. "verbose" gives the same output Crosperf always gave; "quiet" gives minimal output, and "average" is in the middle. The default for now is "verbose". Doing this also involved adding logging levels to the command_executer, and to image_chromeos (again, with the default being "verbose"). BUG=None TEST=Tested all three levels of logging, with and without having to reimage the DUT. It all worked properly. Change-Id: Icf8c9a6831fe25202adcb624c6c7e1d1a7ac25a5 Reviewed-on: https://chrome-internal-review.googlesource.com/156883 Reviewed-by: Caroline Tice <cmtice@google.com> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/experiment_status.py')
-rw-r--r--crosperf/experiment_status.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/crosperf/experiment_status.py b/crosperf/experiment_status.py
index a9ff8edb..f855ca68 100644
--- a/crosperf/experiment_status.py
+++ b/crosperf/experiment_status.py
@@ -16,6 +16,7 @@ class ExperimentStatus(object):
self.num_total = len(self.experiment.benchmark_runs)
self.completed = 0
self.new_job_start_time = time.time()
+ self.log_level = experiment.log_level
def _GetProgressBar(self, num_complete, num_total):
ret = "Done: %s%%" % int(100.0 * num_complete / num_total)
@@ -96,8 +97,9 @@ class ExperimentStatus(object):
(key, self._GetNamesAndIterations(val)))
result = "Thread Status:\n%s" % "\n".join(status_strings)
- # Add the machine manager status.
- result += "\n" + self.experiment.machine_manager.AsString() + "\n"
+ if self.experiment.log_level == "verbose":
+ # Add the machine manager status.
+ result += "\n" + self.experiment.machine_manager.AsString() + "\n"
return result
@@ -107,5 +109,8 @@ class ExperimentStatus(object):
for benchmark_run in benchmark_runs:
t_last = benchmark_run.timeline.GetLastEventTime()
elapsed = str(datetime.timedelta(seconds=int(t-t_last)))
- strings.append("'{0}' {1}".format(benchmark_run.name, elapsed))
+ if self.experiment.log_level == "verbose":
+ strings.append("'{0}' {1}".format(benchmark_run.name, elapsed))
+ else:
+ strings.append("'{0}'".format(benchmark_run.name))
return " %s (%s)" % (len(strings), ", ".join(strings))