Merge pull request #515 from mjibson/monitor-build-node-queue
Monitor queue adds and EC2 node starts
This commit is contained in:
commit
aa8ee4db64
2 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@ from trollius import From, coroutine, Return, async
|
|||
from concurrent.futures import ThreadPoolExecutor
|
||||
from urllib3.exceptions import ReadTimeoutError, ProtocolError
|
||||
|
||||
from app import metric_queue
|
||||
from buildman.manager.basemanager import BaseManager
|
||||
from buildman.manager.executor import PopenExecutor, EC2Executor
|
||||
from buildman.component.buildcomponent import BuildComponent
|
||||
|
@ -335,6 +336,7 @@ class EphemeralBuilderManager(BaseManager):
|
|||
|
||||
try:
|
||||
builder_id = yield From(self._executor.start_builder(realm, token, build_uuid))
|
||||
metric_queue.put('EC2BuilderStarted', 1, unit='Count')
|
||||
except:
|
||||
logger.exception('Exception when starting builder for job: %s', build_uuid)
|
||||
raise Return(False, EC2_API_TIMEOUT)
|
||||
|
|
|
@ -127,7 +127,10 @@ class WorkQueue(object):
|
|||
params['available_after'] = available_date
|
||||
|
||||
with self._transaction_factory(db):
|
||||
return str(QueueItem.create(**params).id)
|
||||
r = str(QueueItem.create(**params).id)
|
||||
if self._metric_queue:
|
||||
self._metric_queue.put('Added', 1, dimensions={'queue': self._queue_name})
|
||||
return r
|
||||
|
||||
def get(self, processing_time=300):
|
||||
"""
|
||||
|
|
Reference in a new issue