diff --git a/buildman/manager/enterprise.py b/buildman/manager/enterprise.py index f144fd504..c56830a1c 100644 --- a/buildman/manager/enterprise.py +++ b/buildman/manager/enterprise.py @@ -1,7 +1,6 @@ import logging import uuid -from app import build_metrics from buildman.component.basecomponent import BaseComponent from buildman.component.buildcomponent import BuildComponent from buildman.manager.basemanager import BaseManager @@ -76,7 +75,6 @@ class EnterpriseManager(BaseManager): @coroutine def job_completed(self, build_job, job_status, build_component): - build_metrics.report(job_status) self.job_complete_callback(build_job, job_status) def build_component_disposed(self, build_component, timed_out): diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 123594190..cfb52f8ad 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -10,7 +10,6 @@ from trollius import From, coroutine, Return, async from concurrent.futures import ThreadPoolExecutor from urllib3.exceptions import ReadTimeoutError, ProtocolError -from app import build_metrics from buildman.manager.basemanager import BaseManager from buildman.manager.executor import PopenExecutor, EC2Executor from buildman.component.buildcomponent import BuildComponent @@ -287,8 +286,6 @@ class EphemeralBuilderManager(BaseManager): job_key = self._etcd_job_key(build_job) yield From(self._etcd_client.delete(job_key)) - build_metrics.report(job_status) - self.job_complete_callback(build_job, job_status) @coroutine diff --git a/buildman/server.py b/buildman/server.py index f077f7e9f..9aad39b5c 100644 --- a/buildman/server.py +++ b/buildman/server.py @@ -15,7 +15,7 @@ from datetime import timedelta from buildman.jobutil.buildstatus import StatusHandler from buildman.jobutil.buildjob import BuildJob, BuildJobLoadException from data import database -from app import app +from app import app, build_metrics # pylint: disable=invalid-name logger = logging.getLogger(__name__) @@ -135,6 +135,8 @@ class BuilderServer(object): minimum_extension=MINIMUM_JOB_EXTENSION) def _job_complete(self, build_job, job_status): + build_metrics.report(job_status) + if job_status == BuildJobResult.INCOMPLETE: self._queue.incomplete(build_job.job_item, restore_retry=False, retry_after=30) else: