summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_artifactcache/pushreceive.py14
-rw-r--r--buildstream/_profile.py3
2 files changed, 16 insertions, 1 deletions
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py
index d2eaf2dc0..a1282d32d 100644
--- a/buildstream/_artifactcache/pushreceive.py
+++ b/buildstream/_artifactcache/pushreceive.py
@@ -21,6 +21,7 @@
import logging
import multiprocessing
import os
+import re
import subprocess
import sys
import shutil
@@ -33,6 +34,7 @@ import click
import gi
from .. import _signals # nopep8
+from .._profile import Topics, profile_start, profile_end
gi.require_version('OSTree', '1.0')
# pylint: disable=wrong-import-position,wrong-import-order
@@ -619,6 +621,16 @@ class OSTreeReceiver(object):
return 0
update_refs = args
+ profile_names = set()
+ for update_ref in update_refs:
+ # Strip off the SHA256 sum on the right of the reference,
+ # leaving the project and element name
+ project_and_element_name = re.sub(r"/[a-z0-9]+$", '', update_ref)
+ profile_names.add(project_and_element_name)
+
+ profile_name = '_'.join(profile_names)
+ profile_start(Topics.ARTIFACT_RECEIVE, profile_name)
+
self.writer.send_status(True)
# Wait for putobjects or done
@@ -661,6 +673,8 @@ class OSTreeReceiver(object):
# Inform pusher that everything is in place
self.writer.send_done()
+ profile_end(Topics.ARTIFACT_RECEIVE, profile_name)
+
return 0
diff --git a/buildstream/_profile.py b/buildstream/_profile.py
index 0bf4a3dcd..4d39cfc5e 100644
--- a/buildstream/_profile.py
+++ b/buildstream/_profile.py
@@ -39,7 +39,7 @@ initialized = False
#
# BST_PROFILE=circ-dep-check:sort-deps bst <command> <args>
#
-# The special 'all' value will enable all profiles
+# The special 'all' value will enable all profiles.
class Topics():
CIRCULAR_CHECK = 'circ-dep-check'
SORT_DEPENDENCIES = 'sort-deps'
@@ -48,6 +48,7 @@ class Topics():
LOAD_PROJECT = 'load-project'
LOAD_PIPELINE = 'load-pipeline'
SHOW = 'show'
+ ARTIFACT_RECEIVE = 'artifact-receive'
ALL = 'all'