diff --git a/src/views/home.vue b/src/views/home.vue index fdd7467..eb94531 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -213,7 +213,9 @@ export default { console.log('res', res) if (res && Object.keys(res).length) { // cpu 占有率 (总的cpuTotal-空闲的cpuFree)/总的cpuTotal - this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100) + // cpuSy cpu使用率 cpuFree cpu空闲率 + // this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100) + this.systemData.cpuPercentage = Math.round(res.cpuSy / (res.cpuSy + res.cpuFree) * 100) // 内存占比 使用的memUsed/总的memTotal this.systemData.memPercentage = Math.round(res.memUsed / res.memTotal * 100)