From 0070c4a92e50c247606bb07367a8caf9cd1a4ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Thu, 26 Oct 2023 21:06:34 +0000 Subject: [PATCH] Bug 1860896 - record profiles of test jobs, r=releng-reviewers,gbrown. Differential Revision: https://phabricator.services.mozilla.com/D191791 --- testing/mozharness/mozharness/base/python.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testing/mozharness/mozharness/base/python.py b/testing/mozharness/mozharness/base/python.py index 8e14f41d661c6..fdc4b57d28f14 100644 --- a/testing/mozharness/mozharness/base/python.py +++ b/testing/mozharness/mozharness/base/python.py @@ -795,7 +795,7 @@ def _start_resource_monitoring(self, action, success=None): from mozsystemmonitor.resourcemonitor import SystemResourceMonitor self.info("Starting resource monitoring.") - self._resource_monitor = SystemResourceMonitor(poll_interval=1.0) + self._resource_monitor = SystemResourceMonitor(poll_interval=0.1) self._resource_monitor.start() except Exception: self.warning( @@ -835,6 +835,14 @@ def _resource_record_post_run(self): json.dump( self._resource_monitor.as_dict(), fh, sort_keys=True, indent=4 ) + with open( + os.path.join(upload_dir, "profile_resource-usage.json"), "w" + ) as fh: + json.dump( + self._resource_monitor.as_profile(), + fh, + separators=(",", ":"), + ) except (AttributeError, KeyError): self.exception("could not upload resource usage JSON", level=WARNING)