Skip to content

Commit

Permalink
Bug 1860896 - record profiles of test jobs, r=releng-reviewers,gbrown.
Browse files Browse the repository at this point in the history
  • Loading branch information
fqueze committed Oct 26, 2023
1 parent 05da626 commit 0070c4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion testing/mozharness/mozharness/base/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 0070c4a

Please sign in to comment.