You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:40:56 UTC
[buildstream] 02/02: _profile.py: Added a new profiling topic,
load-selection
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch jennis/profiling_topics
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 1b2ccd66e84e685e8c3d515f5c0a234cb9e68a03
Author: James Ennis <ja...@codethink.com>
AuthorDate: Fri Jan 18 17:20:42 2019 +0000
_profile.py: Added a new profiling topic, load-selection
profile_start() and profile_end() calls have been added to
Stream.load_selection()
---
buildstream/_profile.py | 1 +
buildstream/_stream.py | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/buildstream/_profile.py b/buildstream/_profile.py
index b293c34..d977c5d 100644
--- a/buildstream/_profile.py
+++ b/buildstream/_profile.py
@@ -46,6 +46,7 @@ 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'
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 62eff1d..26aa645 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -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
@@ -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()