move lookup to a sub command and add mem usage to the bot stats command
Some checks failed
Deploy to Dokku / docker (ubuntu-latest) (push) Has been cancelled
Some checks failed
Deploy to Dokku / docker (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@ -37,4 +37,18 @@ public class StringUtils {
|
||||
}
|
||||
return inputString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats bytes into a human-readable format
|
||||
*
|
||||
* @param bytes the bytes
|
||||
* @return the formatted bytes
|
||||
*/
|
||||
public static String formatBytes(long bytes) {
|
||||
int unit = 1024;
|
||||
if (bytes < unit) return bytes + " B";
|
||||
int exp = (int) (Math.log(bytes) / Math.log(unit));
|
||||
char pre = "KMGTPE".charAt(exp-1);
|
||||
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user