DM-54645: Add garbage collection metrics to task metadata#562
DM-54645: Add garbage collection metrics to task metadata#562andy-slac wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #562 +/- ##
==========================================
- Coverage 88.77% 88.75% -0.03%
==========================================
Files 159 160 +1
Lines 22053 22120 +67
Branches 2623 2625 +2
==========================================
+ Hits 19578 19632 +54
- Misses 1839 1848 +9
- Partials 636 640 +4 ☔ View full report in Codecov by Sentry. |
SingleQuantumExecutor uses new GcMetrics context manager to collect GC metrics and add them to task metadata under "quantum.gc_metrics" key.
fa62385 to
ac0bcb1
Compare
| """GC thresholds on entering context.""" | ||
|
|
||
| end_threshold: list[int] | None = None | ||
| """GC thresholds on exiting context.""" |
There was a problem hiding this comment.
Please add units to the docstrings here.
| start_isenabled: bool | None = None | ||
| """Whether GC is enabled on entering context.""" | ||
|
|
||
| end_isenabled: bool | None = None |
There was a problem hiding this comment.
You are worried a task is going to disable GC?
There was a problem hiding this comment.
I'm not worried, but I want to know if it happens. I imagine some tasks may want to do that (but they may also want to re-enable it on return).
| return None | ||
|
|
||
| try: | ||
| return GcMetrics( |
There was a problem hiding this comment.
Is it more straightforward and future proofed to convert the TaskMetadata to a dictionary and then use the standard pydantic constructor from dict?
There was a problem hiding this comment.
I did not think about that, I'll try it.
Co-authored-by: Tim Jenness <tjenness@lsst.org>
SingleQuantumExecutor uses new GcMetrics context manager to collect
GC metrics and add them to task metadata under "quantum.gc_metrics" key.
Checklist
package-docs builddoc/changes