Skip to content

CpuInternals

fairy edited this page Sep 29, 2019 · 3 revisions

代码示例

CpuInternals.getInstance().getCpuSampler().start();
CpuInternals.getInstance().getCpuSampler().getCpuRateInfoOfJSON();
CpuInternals.getInstance().getCpuSampler().stop();

数据格式

数据信息

[
    {
        "cpu":"55%",
        "app":"45%",
        "ioWait":"0%",
        "system":"0%",
        "time":"1569580013024",
        "user":"55%"
    }
]

具体信息

数据键 数据类型 数据解释 版本适配 预期值
cpu String CPU占有率 <26 😭
app String APP占有率 <26 😭
ioWait String 空闲线程占有率 <26 😭
system String 系统占有率 <26 😭
time String 检测时间戳 >=1 😄
user String 用户占有率 <26 😭