跳到主要内容
版本:latest

GetCpuInfo

获取 CPU 详细信息。调用 psutil.cpu_percent(percpu=True, interval=interval) 采样。

  • 路由POST /system
  • actionGetCpuInfo

输入参数

参数名称必选类型描述
actionString固定值 GetCpuInfo

采样间隔固定为 1 秒,不可通过 API 修改。

输出参数

返回数组 [使用率%, 逻辑核心数, [各核使用率...], CPU名称, 物理核心数, 物理CPU数]

索引类型描述
0Float整体 CPU 使用率(%)
1Integer逻辑核心数
2Array[Float]各核心使用率数组
3StringCPU 型号名称
4Integer物理核心数
5Integer物理 CPU 数

示例

请求

POST /system HTTP/1.1
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetCpuInfo

响应

[12.5, 2, [15.0, 10.0], "Intel Core Processor (Skylake, IBRS)", 1, 1]