Coverage for src/lexigram/admin/settings/panel/profiler_spec.py: 93%
14 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-24 23:18 +0800
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-24 23:18 +0800
1"""Profiler configuration specification."""
3from __future__ import annotations
5from lexigram.admin.settings.panel.models import ProfilerSettings
6from lexigram.admin.settings.panel.nodes import PydanticConfigSpec
7from lexigram.admin.settings.panel.registry import ConfigRegistry
9__all__ = ["ProfilerSpec", "register_spec"]
12class ProfilerSpec(PydanticConfigSpec):
13 """Profiler configuration spec."""
15 namespace = "admin.profiler"
16 label = "Performance Profiler"
17 icon = "clock"
18 description = "Request profiling toggle and slow-request threshold."
19 model = ProfilerSettings
20 required_permissions = frozenset({"admin.settings.edit"})
23def register_spec(registry: ConfigRegistry) -> None:
24 """Register this spec with the config registry."""
25 registry.register_spec(ProfilerSpec)