/
/
/
1"""
2Profiler plugin provider for Music Assistant.
3
4Temporarily install this provider on a running server to diagnose CPU,
5memory and event-loop issues without shell access. While loaded it
6continuously records lightweight health metrics and (optionally) periodic
7CPU profile windows; the aggregated result is available as a shareable
8report via the `profiler/report` API command.
9
10This provider is a debugging aid, not a regular provider: only enable it
11while investigating a performance issue (or when asked to in a support
12request) and uninstall it afterwards.
13"""
14
15from __future__ import annotations
16
17from typing import TYPE_CHECKING
18
19from .provider import ProfilerProvider
20
21if TYPE_CHECKING:
22 from music_assistant_models.config_entries import ProviderConfig
23 from music_assistant_models.provider import ProviderManifest
24
25 from music_assistant.mass import MusicAssistant
26 from music_assistant.models import ProviderInstanceType
27
28
29async def setup(
30 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
31) -> ProviderInstanceType:
32 """Initialize provider(instance) with given configuration."""
33 return ProfilerProvider(mass, manifest, config)
34