Skip to content

ProfileResult

The result available through session.result or profile.result.

dataclass linescope.model.ProfileResult[source]

Combine portable source snapshots with backend-independent run data.

Attributes

root_run : ProfileRun

Root profiling scope and its child run tree.

sources : dict[str, SourceUnit]

Complete source snapshots keyed by stable identifiers.

backend : str | Backend

Built-in collector name or registered custom backend name.

capabilities : BackendCapabilities

Measurements the selected collector actually supports.

symbols : list[SymbolDefinition]

Conservatively resolved definitions across captured source.

warnings : list[str]

Collector and integration limitations recorded during profiling.


See Also

BackendCapabilities

Describe measurements a collector can actually provide.

ProfileRun

Represent a profiling scope and any separately executed child notebooks.

SourceUnit

Preserve the full source text observed during collection.

Example

>>> from linescope import profile

>>> with profile(
...     backend="trace", display="none", notebooks=False, spark=False
... ) as session:
...     total = sum(range(10))

>>> result = session.result
>>> (total, str(result.backend), str(result.root_run.status))
(45, 'trace', 'success')