diff options
author | David Sommerseth <davids@redhat.com> | 2012-12-07 19:41:48 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-12-07 19:41:48 +0100 |
commit | 6d4947630bb398c4e90039ba1e84f2feeb891e4d (patch) | |
tree | 49ab46610ffbb0b803695ef73323bf3a8d8c7d11 | |
parent | aa78df877c932256120b89a169d353859cc4a667 (diff) | |
download | rteval-6d4947630bb398c4e90039ba1e84f2feeb891e4d.tar.gz |
Don't raise an exception if measurement threads stops running
There might be reasons why measurement threads don't complete the
set duration time. If this is an error, that should be handled in
the measurement module and not globally.
If one or more measurement threads have stopped before the duration time
has expired, rather do a controlled exit - generating a report.
Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r-- | rteval/rteval.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rteval/rteval.py b/rteval/rteval.py index 1886163..479c85b 100644 --- a/rteval/rteval.py +++ b/rteval/rteval.py @@ -73,6 +73,7 @@ class RtEval(rtevalReport): default_config = { 'rteval': { + 'quiet' : False, 'verbose' : False, 'keepdata' : True, 'debugging' : False, @@ -127,7 +128,9 @@ class RtEval(rtevalReport): self.config.AppendConfig('rteval', self.cmd_options) # Update log level, based on config/command line args - loglev = (self.config.verbose and Log.INFO) | (self.config.debugging and Log.DEBUG) + loglev = (not self.config.quiet and (Log.ERR | Log.WARN)) \ + | (self.config.verbose and Log.INFO) \ + | (self.config.debugging and Log.DEBUG) self.__logger.SetLogVerbosity(loglev) self.__logger.log(Log.DEBUG, "workdir: %s" % self.workdir) @@ -329,7 +332,9 @@ class RtEval(rtevalReport): while (currtime <= stoptime) and not sigint_received: time.sleep(1.0) if not measure_profile.isAlive(): - raise RuntimeError, "one of the measurement threads died!" + stoptime = currtime + self.__logger.log(Log.WARN, + "Measurement threads did not use the full time slot. Doing a controlled stop.") if with_loads: if len(threading.enumerate()) < nthreads: |