feat: Improved docstrings for /sysinfo endpoint

This commit is contained in:
Matthias
2026-03-13 06:21:06 +01:00
parent 4a9a630765
commit c1fa259ad7
2 changed files with 12 additions and 5 deletions
+11 -4
View File
@@ -703,12 +703,19 @@ class CpuInfo(BaseModel):
class SysInfo(BaseModel):
cpu_pct: list[float]
"""Information about the system running the bot based on psutil output/measurements
Note: cpu_pct is deprecated and may be removed in a future release. Use cpu_load instead.
"""
cpu_pct: list[float] = Field(
default=[], deprecated=True, description="Use cpu_load object instead"
)
cpu_load: list[CpuInfo]
cpu_load_avg: dict[str, float]
cpu_count: int
cpu_avg: float
ram_pct: float
cpu_count: int = Field(description="Number of logical CPUs as provided by psutil")
cpu_avg: float = Field(description="Average CPU load across all cores as provided by psutil")
ram_pct: float = Field(description="RAM usage percentage as provided by psutil")
class Health(BaseModel):
+1 -1
View File
@@ -1739,7 +1739,7 @@ class RPC:
cpu_pct = psutil.cpu_percent(interval=0.1, percpu=True)
load_avg = psutil.getloadavg()
return {
"cpu_pct": cpu_pct,
"cpu_pct": cpu_pct, # Deprecated, use cpu_load instead
"cpu_load": [
{
"cpu": idx,