Skip to content

Backend

Import Backend from linescope to select a built-in collector. Registered custom collectors continue to use their own string names.

enum linescope.enums.Backend[source]

Select a built-in measurement backend.

Registered custom backends continue to use their own string names.

  • TRACE
  • SCALENE
  • TACHYON
Attributes

TRACE : Backend

Measure explicit Python trace events in the calling thread.

SCALENE : Backend

Collect scoped CPU, memory, and optional GPU sampling data.

TACHYON : Backend

Sample Python 3.15 stacks from a separate process.

Example

>>> from linescope import Backend, Config, DisplayMode

>>> config = Config(backend=Backend.TRACE, display=DisplayMode.NONE)
>>> (config.backend is Backend.TRACE, config.display is DisplayMode.NONE)
(True, True)
>>> Backend("trace") is Backend.TRACE
True