Bug 1860896 - include useful metadata (worker type, test type, source URL) in test profiles, r=gbrown.

Differential Revision: https://phabricator.services.mozilla.com/D191977
This commit is contained in:
Florian Quèze 2023-10-26 21:06:35 +00:00
Родитель ea5e4186ba
Коммит 2f062a2efa
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -795,7 +795,24 @@ class ResourceMonitoringMixin(PerfherderResourceOptionsMixin):
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(