# lsdtools.profiling reference
URL: https://lsd.tools/docs/sdk-lsdtools-profiling
Updated: 2026-09-09

SDK distribution **1.0.0**; API contract **1.0**; generator **1.0.0**.

Product source digest: `4ea39055732e8883c03ccfecf12af6ccebd2041a12ce1b843e4a769e200f5ef9`.

Generated from declared public exports and source syntax. Signatures and annotations are declaration spellings; decorators, factories and annotations are never executed. Class members below are declared members; base classes remain explicit. Source docstrings describe their owning implementation; they do not grant app permissions.

```text
Stable package-author facade for LSD profiling.

Package code should import this module instead of reaching into product internals. The
implementation is the stdlib-only :mod:`lsd_profiler` leaf, so importing this facade
does not construct an Engine, UI, worker, or sampler thread.
```


## `lsdtools.profiling.Level`

Kind: class. Source: `core/profiler/src/lsd_profiler/levels.py:13`.

Implementation alias: `lsd_profiler.levels.Level`.

Declared bases: `IntEnum`.

### `lsdtools.profiling.Level.OFF`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/levels.py:14`.

```python
OFF = 0
```


### `lsdtools.profiling.Level.LIGHT`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/levels.py:15`.

```python
LIGHT = 1
```


### `lsdtools.profiling.Level.DEEP`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/levels.py:16`.

```python
DEEP = 2
```


## `lsdtools.profiling.ProfilerLimits`

Kind: class. Source: `core/profiler/src/lsd_profiler/profiler.py:49`.

Source docstring:

```text
Hard cardinality limits for one process-local capture.
```


Implementation alias: `lsd_profiler.profiler.ProfilerLimits`.

### `lsdtools.profiling.ProfilerLimits.spans`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:52`.

```python
spans: int
```


```python
spans = _DEFAULT_MAX_SPANS
```


### `lsdtools.profiling.ProfilerLimits.counters`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:53`.

```python
counters: int
```


```python
counters = _DEFAULT_MAX_COUNTERS
```


### `lsdtools.profiling.ProfilerLimits.active`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:54`.

```python
active: int
```


```python
active = _DEFAULT_MAX_ACTIVE
```


### `lsdtools.profiling.ProfilerLimits.scopes`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:55`.

```python
scopes: int
```


```python
scopes = _DEFAULT_MAX_SCOPES
```


### `lsdtools.profiling.ProfilerLimits.recent`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:56`.

```python
recent: int
```


```python
recent = _DEFAULT_MAX_RECENT
```


### `lsdtools.profiling.ProfilerLimits.gauges`

Kind: attribute. Source: `core/profiler/src/lsd_profiler/profiler.py:57`.

```python
gauges: int
```


```python
gauges = _DEFAULT_MAX_GAUGES
```


## `lsdtools.profiling.configure`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:193`.

```python
configure(*, max_spans: Optional[int]=None, max_counters: Optional[int]=None, max_active: Optional[int]=None, max_scopes: Optional[int]=None, max_recent: Optional[int]=None, max_gauges: Optional[int]=None) -> ProfilerLimits
```


```python
max_active: Optional[int]
max_counters: Optional[int]
max_gauges: Optional[int]
max_recent: Optional[int]
max_scopes: Optional[int]
max_spans: Optional[int]
```


Source docstring:

```text
Configure strict process-local cardinality bounds.
```


Implementation alias: `lsd_profiler.markers.configure`.

## `lsdtools.profiling.count`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:178`.

```python
count(name: str, n: float=1.0) -> None
```


```python
n: float
name: str
```


Implementation alias: `lsd_profiler.markers.count`.

## `lsdtools.profiling.gauge`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:183`.

```python
gauge(name: str, value: float) -> None
```


```python
name: str
value: float
```


Implementation alias: `lsd_profiler.markers.gauge`.

## `lsdtools.profiling.get_level`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:217`.

```python
get_level() -> Level
```


Implementation alias: `lsd_profiler.markers.get_level`.

## `lsdtools.profiling.profile`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:85`.

```python
profile(name: str, /, **meta)
```


```python
meta: (unannotated)
name: str
```


Source docstring:

```text
Profile a generic scope. Returns a shared no-op handle while OFF.
```


Implementation alias: `lsd_profiler.markers.profile`.

## `lsdtools.profiling.profiled`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:150`.

```python
profiled(name=None, **meta)
```


```python
meta: (unannotated)
name: (unannotated)
```


Source docstring:

```text
Decorator form of :func:`profile`; supports sync and async functions.
```


Implementation alias: `lsd_profiler.markers.profiled`.

## `lsdtools.profiling.step`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:95`.

```python
step(name: str, /, **meta)
```


```python
meta: (unannotated)
name: str
```


Source docstring:

```text
Track a step nested inside a task and return an updateable context handle.
```


Implementation alias: `lsd_profiler.markers.step`.

## `lsdtools.profiling.stepped`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:160`.

```python
stepped(name=None, **meta)
```


```python
meta: (unannotated)
name: (unannotated)
```


Source docstring:

```text
Decorator form of :func:`step` for fixed-name/fixed-metadata execution stages.
```


Implementation alias: `lsd_profiler.markers.stepped`.

## `lsdtools.profiling.task`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:90`.

```python
task(name: str, /, **meta)
```


```python
meta: (unannotated)
name: str
```


Source docstring:

```text
Track one user-visible task and return an updateable context handle.
```


Implementation alias: `lsd_profiler.markers.task`.

## `lsdtools.profiling.tasked`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:155`.

```python
tasked(name=None, **meta)
```


```python
meta: (unannotated)
name: (unannotated)
```


Source docstring:

```text
Decorator form of :func:`task` for fixed-name/fixed-metadata public facades.
```


Implementation alias: `lsd_profiler.markers.tasked`.

## `lsdtools.profiling.worker`

Kind: function. Source: `core/profiler/src/lsd_profiler/markers.py:100`.

```python
worker(name: str, /, **meta)
```


```python
meta: (unannotated)
name: str
```


Source docstring:

```text
Track explicit worker ownership/lifetime in the current thread.
```


Implementation alias: `lsd_profiler.markers.worker`.
