From 0208c795499b808c762edbb3d61432410692dd6e Mon Sep 17 00:00:00 2001 From: chenhj <chenhj@lunor.cn> Date: 星期六, 24 五月 2025 14:50:15 +0800 Subject: [PATCH] Merge pull request 'chen' (#7) from chen into master --- ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 101 insertions(+), 0 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java new file mode 100644 index 0000000..a13a66c --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -0,0 +1,101 @@ +package com.ruoyi.framework.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * CPU鐩稿叧淇℃伅 + * + * @author ruoyi + */ +public class Cpu +{ + /** + * 鏍稿績鏁� + */ + private int cpuNum; + + /** + * CPU鎬荤殑浣跨敤鐜� + */ + private double total; + + /** + * CPU绯荤粺浣跨敤鐜� + */ + private double sys; + + /** + * CPU鐢ㄦ埛浣跨敤鐜� + */ + private double used; + + /** + * CPU褰撳墠绛夊緟鐜� + */ + private double wait; + + /** + * CPU褰撳墠绌洪棽鐜� + */ + private double free; + + public int getCpuNum() + { + return cpuNum; + } + + public void setCpuNum(int cpuNum) + { + this.cpuNum = cpuNum; + } + + public double getTotal() + { + return Arith.round(Arith.mul(total, 100), 2); + } + + public void setTotal(double total) + { + this.total = total; + } + + public double getSys() + { + return Arith.round(Arith.mul(sys / total, 100), 2); + } + + public void setSys(double sys) + { + this.sys = sys; + } + + public double getUsed() + { + return Arith.round(Arith.mul(used / total, 100), 2); + } + + public void setUsed(double used) + { + this.used = used; + } + + public double getWait() + { + return Arith.round(Arith.mul(wait / total, 100), 2); + } + + public void setWait(double wait) + { + this.wait = wait; + } + + public double getFree() + { + return Arith.round(Arith.mul(free / total, 100), 2); + } + + public void setFree(double free) + { + this.free = free; + } +} -- Gitblit v1.9.3