Return the global :class:`psutil.Process` instance. Note: Returns :const:`None` if :pypi:`psutil` is not installed.
()
| 143 | |
| 144 | |
| 145 | def ps(): # pragma: no cover |
| 146 | """Return the global :class:`psutil.Process` instance. |
| 147 | |
| 148 | Note: |
| 149 | Returns :const:`None` if :pypi:`psutil` is not installed. |
| 150 | """ |
| 151 | global _process |
| 152 | if _process is None and Process is not None: |
| 153 | _process = Process(os.getpid()) |
| 154 | return _process |
| 155 | |
| 156 | |
| 157 | def _process_memory_info(process): |
no outgoing calls