Skip to content

Commit

Permalink
Bug 1860896 - include useful metadata (worker type, test type, source…
Browse files Browse the repository at this point in the history
… URL) in test profiles, r=gbrown.

Differential Revision: https://phabricator.services.mozilla.com/D191977
  • Loading branch information
fqueze committed Oct 26, 2023
1 parent ea5e418 commit 2f062a2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion testing/mozharness/mozharness/base/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,24 @@ def _start_resource_monitoring(self, action, success=None):
from mozsystemmonitor.resourcemonitor import SystemResourceMonitor

self.info("Starting resource monitoring.")
self._resource_monitor = SystemResourceMonitor(poll_interval=0.1)
metadata = {}
if "TASKCLUSTER_WORKER_TYPE" in os.environ:
metadata["device"] = os.environ["TASKCLUSTER_WORKER_TYPE"]
if "MOZHARNESS_TEST_PATHS" in os.environ:
metadata["product"] = " ".join(
json.loads(os.environ["MOZHARNESS_TEST_PATHS"]).keys()
)
if "MOZ_SOURCE_CHANGESET" in os.environ and "MOZ_SOURCE_REPO" in os.environ:
metadata["sourceURL"] = (
os.environ["MOZ_SOURCE_REPO"]
+ "/rev/"
+ os.environ["MOZ_SOURCE_CHANGESET"]
)
if "TASK_ID" in os.environ:
metadata["appBuildID"] = os.environ["TASK_ID"]
self._resource_monitor = SystemResourceMonitor(
poll_interval=0.1, metadata=metadata
)
self._resource_monitor.start()
except Exception:
self.warning(
Expand Down

0 comments on commit 2f062a2

Please sign in to comment.