refactor: 注释掉不必要的内存和CPU使用率计算逻辑

This commit is contained in:
TsMask
2025-02-28 19:43:54 +08:00
parent 62bb7462d1
commit f5f67b5023

View File

@@ -232,23 +232,23 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
}
tableState.selectedRowKeys = keys;
// Mem 将KB转换为MB
const totalMemInKB = neState.mem?.totalMem;
const nfUsedMemInKB = neState.mem?.nfUsedMem;
const sysMemUsageInKB = neState.mem?.sysMemUsage;
const totalMemInMB = Math.round((totalMemInKB / 1024) * 100) / 100;
const nfUsedMemInMB = Math.round((nfUsedMemInKB / 1024) * 100) / 100;
const sysMemUsageInMB = Math.round((sysMemUsageInKB / 1024) * 100) / 100;
// const totalMemInKB = neState.mem?.totalMem;
// const nfUsedMemInKB = neState.mem?.nfUsedMem;
// const sysMemUsageInKB = neState.mem?.sysMemUsage;
// const totalMemInMB = Math.round((totalMemInKB / 1024) * 100) / 100;
// const nfUsedMemInMB = Math.round((nfUsedMemInKB / 1024) * 100) / 100;
// const sysMemUsageInMB = Math.round((sysMemUsageInKB / 1024) * 100) / 100;
// CPU
const nfCpu = neState.cpu?.nfCpuUsage;
const sysCpu = neState.cpu?.sysCpuUsage;
const nfCpuP = Math.round(nfCpu) / 100;
const sysCpuP = Math.round(sysCpu) / 100;
// const nfCpu = neState.cpu?.nfCpuUsage;
// const sysCpu = neState.cpu?.sysCpuUsage;
// const nfCpuP = Math.round(nfCpu) / 100;
// const sysCpuP = Math.round(sysCpu) / 100;
serverState.value = Object.assign(
{
cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`,
memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`,
// cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`,
// memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`,
},
neState
);
@@ -369,12 +369,12 @@ onBeforeUnmount(() => {
<a-descriptions-item :label="t('views.index.capability')">
{{ serverState.capability }}
</a-descriptions-item>
<a-descriptions-item :label="t('views.index.cpuUse')">
<!-- <a-descriptions-item :label="t('views.index.cpuUse')">
{{ serverState.cpuUse }}
</a-descriptions-item>
<a-descriptions-item :label="t('views.index.memoryUse')">
{{ serverState.memoryUse }}
</a-descriptions-item>
</a-descriptions-item> -->
<a-descriptions-item :label="t('views.index.serialNum')">
{{ serverState.sn }}
</a-descriptions-item>