This commit is contained in:
devezhao-mbp 2020-06-22 23:00:55 +08:00
parent 135d7bc665
commit 5340ecd0f8
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}
}

View file

@ -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>