mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Add getSystemLoad method
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
d51d03e0fa
commit
c573672fce
1 changed files with 5 additions and 1 deletions
|
@ -30,12 +30,16 @@ public class Profiler {
|
|||
}
|
||||
|
||||
public static void printSystemLoad() {
|
||||
log.info(getSystemLoad());
|
||||
}
|
||||
|
||||
public static String getSystemLoad() {
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
long free = runtime.freeMemory();
|
||||
long total = runtime.totalMemory();
|
||||
long used = total - free;
|
||||
|
||||
log.info("Total memory: {}; Used memory: {}; Free memory: {}; Max memory: {}; No. of threads: {}",
|
||||
return String.format("Total memory: %s; Used memory: %s; Free memory: %s; Max memory: %s; No. of threads: %s",
|
||||
Utilities.readableFileSize(total),
|
||||
Utilities.readableFileSize(used),
|
||||
Utilities.readableFileSize(free),
|
||||
|
|
Loading…
Add table
Reference in a new issue