From 3c4fee1db116c11d4f04727cfe076d7c94daeaf2 Mon Sep 17 00:00:00 2001 From: yanzhaofeige <yanzhaofeige@qq.com> Date: Mon, 30 Sep 2024 12:10:57 +0800 Subject: [PATCH] init --- cpzidc-framework/src/main/java/com/odcc/cpzidc/framework/web/domain/server/Mem.java | 61 ++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-) diff --git a/cpzidc-framework/src/main/java/com/odcc/cpzidc/framework/web/domain/server/Mem.java b/cpzidc-framework/src/main/java/com/odcc/cpzidc/framework/web/domain/server/Mem.java new file mode 100644 index 0000000..781fca2 --- /dev/null +++ b/cpzidc-framework/src/main/java/com/odcc/cpzidc/framework/web/domain/server/Mem.java @@ -0,0 +1,61 @@ +package com.odcc.cpzidc.framework.web.domain.server; + +import com.odcc.cpzidc.common.utils.Arith; + +/** + * 內存相关信息 + * + * @author ruoyi + */ +public class Mem +{ + /** + * 内存总量 + */ + private double total; + + /** + * 已用内存 + */ + private double used; + + /** + * 剩余内存 + */ + private double free; + + public double getTotal() + { + return Arith.div(total, (1024 * 1024 * 1024), 2); + } + + public void setTotal(long total) + { + this.total = total; + } + + public double getUsed() + { + return Arith.div(used, (1024 * 1024 * 1024), 2); + } + + public void setUsed(long used) + { + this.used = used; + } + + public double getFree() + { + return Arith.div(free, (1024 * 1024 * 1024), 2); + } + + public void setFree(long free) + { + this.free = free; + } + + public double getUsage() + { + return Arith.mul(Arith.div(used, total, 4), 100); + } +} -- Gitblit v1.9.3