feat: Improved docstrings for /sysinfo endpoint
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user