Config
Configure a single profiling session.
| Parameters |
backend : str | Backend, default=default_backend() Built-in backend member, its string value, or a registered engine
name. Default to Trace on Python 3.11-3.15. Select Collect process RAM and retained Python allocation changes separately, using the shared memory collector. 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 preserves the backend default of 1000 for Scalene and Tachyon. Higher rates increase collection overhead. Trace ignores this setting. The achieved rate can differ depending on operating-system timer resolution and scheduling settings.
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 Spark driver actions lazily when Spark methods are used. Require PySpark to be available in the existing environment. Leave PySpark unloaded and its JVM listener dormant until needed.
notebooks : bool, default=True Snapshot notebook cells and instrument available notebook integrations.
child_notebooks : bool, default=True Automatically snapshot and profile Databricks child notebooks using temporary workspace copies when SDK access permits it.
display : str | DisplayMode, default=DisplayMode.END Display a full report at completion (
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