diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-04-02 16:21:17 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-04-09 11:01:44 +0000 |
commit | 3bae7387ea8c0f75294cfc939f942c61134b2dda (patch) | |
tree | 36d89d9bf4acc170e46ec9401de83f8116c94009 /distbuild/worker_build_scheduler.py | |
parent | 1eb4aded65367880fe9b859d35b1a3c30ed846d6 (diff) | |
download | morph-3bae7387ea8c0f75294cfc939f942c61134b2dda.tar.gz |
distbuild: Make 'Current jobs' log message more useful
It's good to know which jobs are in progress and which are queued, when
reading morph-controller.log.
Old output:
2015-04-09 10:40:58 DEBUG Current jobs:
['3f647933a1effbb128c857225ba77e9aa775d92314ef0acf3e58e084a7248c73.chunk.stage1-binutils-misc',
'd7279e4179a31d8a3a98c27d5b01ad1bb7387c7fab623fee1086ab68af2784bb.chunk.stage2-fhs-dirs-misc']
New output:
2015-04-09 10:40:58 DEBUG Current jobs:
['3f647933a1effbb128c857225ba77e9aa775d92314ef0acf3e58e084a7248c73.chunk.stage1-binutils-misc (given to worker1:3434)',
'd7279e4179a31d8a3a98c27d5b01ad1bb7387c7fab623fee1086ab68af2784bb.chunk.stage2-fhs-dirs-misc (given to worker2:3434)']
Change-Id: Ie89e6723b0da5f930813591a3166301fd3966804
Diffstat (limited to 'distbuild/worker_build_scheduler.py')
-rw-r--r-- | distbuild/worker_build_scheduler.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/distbuild/worker_build_scheduler.py b/distbuild/worker_build_scheduler.py index e58059b2..919a90e4 100644 --- a/distbuild/worker_build_scheduler.py +++ b/distbuild/worker_build_scheduler.py @@ -149,8 +149,14 @@ class Jobs(object): return waiting.pop() if len(waiting) > 0 else None def __repr__(self): - return str([job.artifact.basename() - for (_, job) in self._jobs.iteritems()]) + items = [] + for job in self._jobs.itervalues(): + if job.who is None: + state = 'queued' + else: + state = 'given to %s' % job.who + items.append('%s (%s)' % (job.artifact.basename(), state)) + return str(items) class _BuildFinished(object): @@ -412,6 +418,9 @@ class WorkerConnection(distbuild.StateMachine): def current_job(self): return self._current_job + def __str__(self): + return self.name() + def setup(self): distbuild.crash_point() |