Loading buildstream/_profile.py +4 −0 Original line number Diff line number Diff line # # Copyright (C) 2017 Codethink Limited # Copyright (C) 2019 Bloomberg Finance LP # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public Loading @@ -16,6 +17,7 @@ # # Authors: # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> # James Ennis <james.ennis@codethink.co.uk> import cProfile import pstats Loading Loading @@ -46,6 +48,8 @@ class Topics(): LOAD_CONTEXT = 'load-context' LOAD_PROJECT = 'load-project' LOAD_PIPELINE = 'load-pipeline' LOAD_SELECTION = 'load-selection' SCHEDULER = 'scheduler' SHOW = 'show' ARTIFACT_RECEIVE = 'artifact-receive' ALL = 'all' Loading buildstream/_scheduler/scheduler.py +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from contextlib import contextmanager # Local imports from .resources import Resources, ResourceType from .jobs import JobStatus, CacheSizeJob, CleanupJob from .._profile import Topics, profile_start, profile_end # A decent return code for Scheduler.run() Loading Loading @@ -154,11 +155,16 @@ class Scheduler(): # Check if we need to start with some cache maintenance self._check_cache_management() # Start the profiler profile_start(Topics.SCHEDULER, "_".join(queue.action_name for queue in self.queues)) # Run the queues self._sched() self.loop.run_forever() self.loop.close() profile_end(Topics.SCHEDULER, "_".join(queue.action_name for queue in self.queues)) # Stop handling unix signals self._disconnect_signals() Loading buildstream/_stream.py +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ from ._exceptions import StreamError, ImplError, BstError, set_last_task_error from ._message import Message, MessageType from ._scheduler import Scheduler, SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue from ._pipeline import Pipeline, PipelineSelection from ._profile import Topics, profile_start, profile_end from . import utils, _yaml, _site from . import Scope, Consistency Loading Loading @@ -106,10 +107,16 @@ class Stream(): def load_selection(self, targets, *, selection=PipelineSelection.NONE, except_targets=()): profile_start(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets)) elements, _ = self._load(targets, (), selection=selection, except_targets=except_targets, fetch_subprojects=False) profile_end(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets)) return elements # shell() Loading Loading
buildstream/_profile.py +4 −0 Original line number Diff line number Diff line # # Copyright (C) 2017 Codethink Limited # Copyright (C) 2019 Bloomberg Finance LP # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public Loading @@ -16,6 +17,7 @@ # # Authors: # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> # James Ennis <james.ennis@codethink.co.uk> import cProfile import pstats Loading Loading @@ -46,6 +48,8 @@ class Topics(): LOAD_CONTEXT = 'load-context' LOAD_PROJECT = 'load-project' LOAD_PIPELINE = 'load-pipeline' LOAD_SELECTION = 'load-selection' SCHEDULER = 'scheduler' SHOW = 'show' ARTIFACT_RECEIVE = 'artifact-receive' ALL = 'all' Loading
buildstream/_scheduler/scheduler.py +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from contextlib import contextmanager # Local imports from .resources import Resources, ResourceType from .jobs import JobStatus, CacheSizeJob, CleanupJob from .._profile import Topics, profile_start, profile_end # A decent return code for Scheduler.run() Loading Loading @@ -154,11 +155,16 @@ class Scheduler(): # Check if we need to start with some cache maintenance self._check_cache_management() # Start the profiler profile_start(Topics.SCHEDULER, "_".join(queue.action_name for queue in self.queues)) # Run the queues self._sched() self.loop.run_forever() self.loop.close() profile_end(Topics.SCHEDULER, "_".join(queue.action_name for queue in self.queues)) # Stop handling unix signals self._disconnect_signals() Loading
buildstream/_stream.py +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ from ._exceptions import StreamError, ImplError, BstError, set_last_task_error from ._message import Message, MessageType from ._scheduler import Scheduler, SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue from ._pipeline import Pipeline, PipelineSelection from ._profile import Topics, profile_start, profile_end from . import utils, _yaml, _site from . import Scope, Consistency Loading Loading @@ -106,10 +107,16 @@ class Stream(): def load_selection(self, targets, *, selection=PipelineSelection.NONE, except_targets=()): profile_start(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets)) elements, _ = self._load(targets, (), selection=selection, except_targets=except_targets, fetch_subprojects=False) profile_end(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets)) return elements # shell() Loading