I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 2d86e7cf authored by zzz's avatar zzz
Browse files

add router.memoryUsed stat

parent 847c9daf
No related branches found
No related tags found
No related merge requests found
......@@ -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" +
......
......@@ -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;
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment