Merge pull request #601 from coreos-inc/remove-transaction
Remove transaction from metric reporting
This commit is contained in:
commit
e2c6113455
2 changed files with 12 additions and 14 deletions
|
@ -65,7 +65,7 @@ class BuilderServer(object):
|
||||||
|
|
||||||
@controller_app.route('/status')
|
@controller_app.route('/status')
|
||||||
def status():
|
def status():
|
||||||
metrics = server._queue.get_metrics(require_transaction=False)
|
metrics = server._queue.get_metrics()
|
||||||
(running_count, available_not_running_count, available_count) = metrics
|
(running_count, available_not_running_count, available_count) = metrics
|
||||||
|
|
||||||
workers = [component for component in server._current_components
|
workers = [component for component in server._current_components
|
||||||
|
|
|
@ -67,9 +67,7 @@ class WorkQueue(object):
|
||||||
def _item_by_id_for_update(self, queue_id):
|
def _item_by_id_for_update(self, queue_id):
|
||||||
return db_for_update(QueueItem.select().where(QueueItem.id == queue_id)).get()
|
return db_for_update(QueueItem.select().where(QueueItem.id == queue_id)).get()
|
||||||
|
|
||||||
def get_metrics(self, require_transaction=True):
|
def get_metrics(self):
|
||||||
guard = self._transaction_factory(db) if require_transaction else NoopWith()
|
|
||||||
with guard:
|
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
name_match_query = self._name_match_query()
|
name_match_query = self._name_match_query()
|
||||||
|
|
||||||
|
|
Reference in a new issue