()
| 186 | proc = psutil.Process() |
| 187 | |
| 188 | def _monitor() -> None: |
| 189 | peak = 0.0 |
| 190 | while not self._stop_evt.wait(timeout=0.15): |
| 191 | try: |
| 192 | mem = proc.memory_info().rss / 1_048_576 # bytes → MB |
| 193 | peak = max(peak, mem) |
| 194 | cpu = proc.cpu_percent() |
| 195 | if cpu > 0: |
| 196 | self._cpu_samples.append(cpu) |
| 197 | except Exception: |
| 198 | break |
| 199 | self.peak_memory_mb = peak |
| 200 | |
| 201 | self._mon_thread = threading.Thread(target=_monitor, daemon=True) |
| 202 | self._mon_thread.start() |
nothing calls this directly
no outgoing calls
no test coverage detected