diff --git a/apps/routerconsole/java/bundle-messages.sh b/apps/routerconsole/java/bundle-messages.sh index 1f8ecc3a4715235ae081cea4b89e4ee28f3354c4..01f4d05a6307cbc2a87e0988fb907ff309edc9b4 100755 --- a/apps/routerconsole/java/bundle-messages.sh +++ b/apps/routerconsole/java/bundle-messages.sh @@ -43,6 +43,7 @@ fi # list specific files in core/ and router/ here, so we don't scan the whole tree ROUTERFILES="\ ../../../core/java/src/net/i2p/data/DataHelper.java \ + ../../../router/java/src/net/i2p/router/Router.java \ ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \ ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java \ ../../../router/java/src/net/i2p/router/transport/TransportManager.java \ diff --git a/apps/routerconsole/java/strings/Strings.java b/apps/routerconsole/java/strings/Strings.java index b71541c78b0cfeb488b6ef0cfcfa3c72185c6e95..5a45fd770d59cfb50c1a7de9a1750be4041cfb0e 100644 --- a/apps/routerconsole/java/strings/Strings.java +++ b/apps/routerconsole/java/strings/Strings.java @@ -95,13 +95,5 @@ class Dummy { _("itag0"); _("itag1"); _("itag2"); - - // Descriptions for the stats that are graphed by default - // There are over 500 stats currently defined, we aren't going to tag them all - _("Low-level bandwidth receive rate"); // bw.recvRate - _("Low-level bandwidth send rate"); // bw.sendRate - _("How many peers we are actively talking with"); // router.activePeers - // router.memoryUsed currently has the max size in the description so it can't be tagged - } } diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 6fb67b53b91532ed0413ef9ac7f82fe95619a76b..177bed0c96f8c81142a2af0fcb024d2ee1df5917 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -1421,6 +1421,17 @@ public class Router { return Math.max(send, recv); } + /** + * Mark a string for extraction by xgettext and translation. + * Use this only in static initializers. + * It does not translate! + * @return s + * @since 0.8.7 + */ + private static final String _x(String s) { + return s; + } + /* following classes are now private static inner classes, didn't bother to reindent */ private static final long LOW_MEMORY_THRESHOLD = 5 * 1024 * 1024; @@ -1435,19 +1446,22 @@ private static class CoalesceStatsEvent implements SimpleTimer.TimedEvent { public CoalesceStatsEvent(RouterContext ctx) { _ctx = ctx; - ctx.statManager().createRequiredRateStat("bw.receiveBps", "Message receive rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); - // used in the router watchdog - ctx.statManager().createRequiredRateStat("bw.sendBps", "Message send rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); - ctx.statManager().createRequiredRateStat("bw.sendRate", "Low-level send rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); - ctx.statManager().createRequiredRateStat("bw.recvRate", "Low-level receive rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); - ctx.statManager().createRequiredRateStat("router.activePeers", "How many peers we are actively talking with", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); + // NOTE TO TRANSLATORS - each of these phrases is a description for a statistic + // to be displayed on /stats.jsp and in the graphs on /graphs.jsp. + // Please keep relatively short so it will fit on the graphs. + ctx.statManager().createRequiredRateStat("bw.receiveBps", _x("Message receive rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); + ctx.statManager().createRequiredRateStat("bw.sendBps", _x("Message send rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); + ctx.statManager().createRequiredRateStat("bw.sendRate", _x("Low-level send rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); + ctx.statManager().createRequiredRateStat("bw.recvRate", _x("Low-level receive rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l }); + ctx.statManager().createRequiredRateStat("router.activePeers", _x("How many peers we are actively talking with"), "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 }); 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().createRequiredRateStat("router.fastPeers", "Known fast peers", "Throttle", new long[] { 5*60*1000, 60*60*1000 }); + ctx.statManager().createRequiredRateStat("router.fastPeers", _x("Known fast peers"), "Throttle", new long[] { 5*60*1000, 60*60*1000 }); _maxMemory = Runtime.getRuntime().maxMemory(); String legend = "(Bytes)"; if (_maxMemory < Long.MAX_VALUE) legend += " Max is " + DataHelper.formatSize(_maxMemory) + 'B'; + // router.memoryUsed currently has the max size in the description so it can't be tagged ctx.statManager().createRequiredRateStat("router.memoryUsed", legend, "Router", new long[] { 60*1000 }); } private RouterContext getContext() { return _ctx; }