mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-21 15:56:53 +08:00
cpu load
This commit is contained in:
parent
135d7bc665
commit
5340ecd0f8
|
@ -13,7 +13,6 @@ import cn.devezhao.commons.SystemUtils;
|
|||
import cn.devezhao.commons.ThrowableUtils;
|
||||
import cn.devezhao.commons.runtime.MemoryInformation;
|
||||
import cn.devezhao.commons.runtime.MemoryInformationBean;
|
||||
import cn.devezhao.commons.runtime.RuntimeInformation;
|
||||
import cn.devezhao.persist4j.util.SqlHelper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.rebuild.server.helper.AesPreferencesConfigurer;
|
||||
|
@ -218,7 +217,7 @@ public final class ServerStatus {
|
|||
* @return
|
||||
*/
|
||||
public static double getSystemLoad() {
|
||||
double load = new RuntimeInformation().getProcessLoad();
|
||||
return load < 0 ? 0 : ObjectUtils.round(load * 100, 2);
|
||||
double load = SystemUtils.getRuntimeInformation().getSystemLoad();
|
||||
return load < 0 ? 0 : ObjectUtils.round(load, 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>CPU Load</th>
|
||||
<td><%=ServerStatus.getSystemLoad() %>%</td>
|
||||
<% double load = ServerStatus.getSystemLoad(); %>
|
||||
<td><%=load < 0 ? "n/a" : load%></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue