Skip to content

Commit

Permalink
#85 show memory
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 19, 2017
1 parent cfbacd4 commit 7e528ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/org/jpeek/web/Futures.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ public Future<Func<String, Response>> apply(final String group,
public String asString() throws IOException {
return Logger.format(
// @checkstyle LineLength (1 line)
"Artifacts=%d, processors=%d, threads=%d, freeMemory=%d, maxMemory=%d, ETA=%[ms]s:\n%s\n\nThreads: %s",
"Artifacts=%d, processors=%d, threads=%d, freeMemory=%dM, maxMemory=%dM, totalMemory=%dM, ETA=%[ms]s:\n%s\n\nThreads: %s",
this.queue.size(),
Runtime.getRuntime().availableProcessors(),
Thread.getAllStackTraces().keySet().size(),
Runtime.getRuntime().freeMemory(),
Runtime.getRuntime().maxMemory(),
// @checkstyle MagicNumber (3 lines)
Runtime.getRuntime().freeMemory() / (1024L << 10),
Runtime.getRuntime().maxMemory() / (1024L << 10),
Runtime.getRuntime().totalMemory() / (1024L << 10),
new AvgOf(
this.times.toArray(new Long[this.times.size()])
).longValue() * (long) this.queue.size(),
Expand Down

0 comments on commit 7e528ed

Please sign in to comment.