Skip to content

Commit

Permalink
feat: use process cpu load instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Deivu committed Jul 26, 2024
1 parent 5b13621 commit 4be53ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Build folder
build/*

# Compiled class file
*.class

Expand Down
2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/haruna/misc/HarunaStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void updateJsonObject() {
.put("saved_data", harunaServer.store.savedCount())
.put("api_requests_received", harunaServer.requestsReceived)
.put("program_uptime", TimeUtil.getSimpleTimeFormat(this.harunaServer.runtime.getUptime()))
.put("cpu_usage", Math.round(system.getCpuLoad() * 100) + " %")
.put("cpu_usage", Math.round(system.getProcessCpuLoad() * 100) + " %")
.put("used_memory", harunaServer.harunaUtil.convertRam(totalMemory - freeMemory))
.put("allocated_free", harunaServer.harunaUtil.convertRam(freeMemory))
.put("allocated_reserved", harunaServer.harunaUtil.convertRam(totalMemory))
Expand Down

0 comments on commit 4be53ca

Please sign in to comment.