Add duration metric collector decorator (#1885)
Track time-to-start for builders Track time-to-build for builders Track ec2 builder fallbacks Track build time
This commit is contained in:
parent
85d611e2fb
commit
832ee89923
5 changed files with 110 additions and 5 deletions
|
@ -17,6 +17,7 @@ from functools import partial
|
|||
from buildman.asyncutil import AsyncWrapper
|
||||
from container_cloud_config import CloudConfigContext
|
||||
from app import metric_queue, app
|
||||
from util.metrics.metricqueue import duration_collector_async
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -131,6 +132,7 @@ class EC2Executor(BuilderExecutor):
|
|||
return stack_amis[ec2_region]
|
||||
|
||||
@coroutine
|
||||
@duration_collector_async(metric_queue.builder_time_to_start, ['ec2'])
|
||||
def start_builder(self, realm, token, build_uuid):
|
||||
region = self.executor_config['EC2_REGION']
|
||||
channel = self.executor_config.get('COREOS_CHANNEL', 'stable')
|
||||
|
@ -240,6 +242,7 @@ class PopenExecutor(BuilderExecutor):
|
|||
""" Executor which uses Popen to fork a quay-builder process.
|
||||
"""
|
||||
@coroutine
|
||||
@duration_collector_async(metric_queue.builder_time_to_start, ['fork'])
|
||||
def start_builder(self, realm, token, build_uuid):
|
||||
# Now start a machine for this job, adding the machine id to the etcd information
|
||||
logger.debug('Forking process for build')
|
||||
|
@ -391,6 +394,7 @@ class KubernetesExecutor(BuilderExecutor):
|
|||
}
|
||||
|
||||
@coroutine
|
||||
@duration_collector_async(metric_queue.builder_time_to_start, ['k8s'])
|
||||
def start_builder(self, realm, token, build_uuid):
|
||||
# generate resource
|
||||
channel = self.executor_config.get('COREOS_CHANNEL', 'stable')
|
||||
|
|
Reference in a new issue