Config
Configure a single profiling session.
| Parameters |
backend : str | Backend, default=default_backend() Built-in or registered collector name. Defaults to Trace. Collect process RAM and retained Python allocations separately. Collect supported Scalene GPU utilization and device memory. Trace warns and continues Python profiling without GPU measurements.
sample_rate : int | None, default=None Target samples per second for Scalene or Tachyon. None uses 1000. Trace ignores this setting; the achieved rate can vary.
root : str | None, default=None Project directory; otherwise discover the nearest
include : tuple[str, ...], default=() Package names, filesystem paths, or project-relative glob patterns.
exclude : tuple[str, ...], default=() Package names, filesystem paths, or project-relative glob patterns. Observe existing Spark actions. Requires PySpark; no actions are forced.
notebooks : bool, default=True Capture executed notebook cells and their source links.
child_notebooks : bool, default=True Profile Databricks child notebooks through temporary workspace copies. Requires SDK access and workspace permissions.
display : str | DisplayMode, default=DisplayMode.END Full report at stop (
output : str | None, default=None Explicit report destination. None opens a temporary HTML report. |
See Also
Example
>>> from linescope.config import Config
>>> Config(backend="trace").memory
False