diff --git a/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java b/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java index 6fc982386520ce759f08b6fddb93c6c58efa4f0b..331f42d890a2c06e2b2c95e61ddeb6494b61b3b2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java @@ -54,6 +54,7 @@ public class StatSummarizer implements Runnable { // ",udp.receivePacketSkew.60000" + // ",udp.sendConfirmTime.60000" + // ",udp.sendPacketSize.60000" + + ",router.memoryUsed.60000" + ",router.activePeers.60000"; // ",router.activeSendPeers.60000" + // ",tunnel.acceptLoad.60000" + diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java index ef227451276c1eb5620b15ca7ec190a83f96925a..6ef9df9db43dc9154a9e8ba10deea9ec5718c36e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java @@ -184,7 +184,7 @@ class SummaryRenderer { def.setTimePeriod(start/1000, 0); String name = _listener.getRate().getRateStat().getName(); // heuristic to set K=1024 - if ((name.startsWith("bw.") || name.indexOf("Size") >= 0 || name.indexOf("Bps") >= 0) + if ((name.startsWith("bw.") || name.indexOf("Size") >= 0 || name.indexOf("Bps") >= 0 || name.indexOf("memory") >= 0) && !showEvents) def.setBaseValue(1024); String title = name; diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 591414fd01b291fa297c85ffd8e2979a3ae0caf7..f7342413afdcb0413d1d13c5962ad9451e181a75 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -1215,6 +1215,8 @@ class CoalesceStatsEvent implements SimpleTimer.TimedEvent { ctx.statManager().createRateStat("router.activeSendPeers", "How many peers we've sent to this minute", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.highCapacityPeers", "How many high capacity peers we know", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); ctx.statManager().createRateStat("router.fastPeers", "How many fast peers we know", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); + long max = Runtime.getRuntime().maxMemory() / (1024*1024); + ctx.statManager().createRateStat("router.memoryUsed", "(Bytes) Max is " + max + "MB", "Router", new long[] { 60*1000 }); } private RouterContext getContext() { return _ctx; } public void timeReached() { @@ -1233,6 +1235,9 @@ class CoalesceStatsEvent implements SimpleTimer.TimedEvent { getContext().statManager().addRateData("bw.sendRate", (long)getContext().bandwidthLimiter().getSendBps(), 0); getContext().statManager().addRateData("bw.recvRate", (long)getContext().bandwidthLimiter().getReceiveBps(), 0); + long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + getContext().statManager().addRateData("router.memoryUsed", used, 0); + getContext().tunnelDispatcher().updateParticipatingStats(); getContext().statManager().coalesceStats();