wujian
2024-02-22 268beb4ebc1e5b8d4ad715b71cd64a0944073a87
提交 | 用户 | 时间
268beb 1 package com.jcdm.framework.web.domain.server;
W 2
3 import com.jcdm.common.utils.Arith;
4
5 /**
6  * CPU相关信息
7  * 
8  * @author jc
9  */
10 public class Cpu
11 {
12     /**
13      * 核心数
14      */
15     private int cpuNum;
16
17     /**
18      * CPU总的使用率
19      */
20     private double total;
21
22     /**
23      * CPU系统使用率
24      */
25     private double sys;
26
27     /**
28      * CPU用户使用率
29      */
30     private double used;
31
32     /**
33      * CPU当前等待率
34      */
35     private double wait;
36
37     /**
38      * CPU当前空闲率
39      */
40     private double free;
41
42     public int getCpuNum()
43     {
44         return cpuNum;
45     }
46
47     public void setCpuNum(int cpuNum)
48     {
49         this.cpuNum = cpuNum;
50     }
51
52     public double getTotal()
53     {
54         return Arith.round(Arith.mul(total, 100), 2);
55     }
56
57     public void setTotal(double total)
58     {
59         this.total = total;
60     }
61
62     public double getSys()
63     {
64         return Arith.round(Arith.mul(sys / total, 100), 2);
65     }
66
67     public void setSys(double sys)
68     {
69         this.sys = sys;
70     }
71
72     public double getUsed()
73     {
74         return Arith.round(Arith.mul(used / total, 100), 2);
75     }
76
77     public void setUsed(double used)
78     {
79         this.used = used;
80     }
81
82     public double getWait()
83     {
84         return Arith.round(Arith.mul(wait / total, 100), 2);
85     }
86
87     public void setWait(double wait)
88     {
89         this.wait = wait;
90     }
91
92     public double getFree()
93     {
94         return Arith.round(Arith.mul(free / total, 100), 2);
95     }
96
97     public void setFree(double free)
98     {
99         this.free = free;
100     }
101 }