ProfileResult
Read session.result or profile.result for the complete profile, including
source snapshots, warnings, and child runs. Normal profiling returns this
object without requiring you to construct it.
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. Collector and integration limitations recorded during profiling. |
See Also
Describe measurements a collector can actually provide.
Represent a profiling scope and any separately executed child notebooks.
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')