Changeset 8d42ebc


Ignore:
Timestamp:
Jun 5, 2011 11:16:57 AM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4d34078
Parents:
87cad7e
Message:
  • Console: Tag stat descriptions at declaration rather than in Strings.java
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/bundle-messages.sh

    r87cad7e r8d42ebc  
    4444ROUTERFILES="\
    4545   ../../../core/java/src/net/i2p/data/DataHelper.java \
     46   ../../../router/java/src/net/i2p/router/Router.java \
    4647   ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \
    4748   ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java \
  • apps/routerconsole/java/strings/Strings.java

    r87cad7e r8d42ebc  
    9696        _("itag1");
    9797        _("itag2");
    98 
    99         // Descriptions for the stats that are graphed by default
    100         // There are over 500 stats currently defined, we aren't going to tag them all
    101         _("Low-level bandwidth receive rate");             // bw.recvRate
    102         _("Low-level bandwidth send rate");                // bw.sendRate
    103         _("How many peers we are actively talking with");  // router.activePeers
    104         // router.memoryUsed currently has the max size in the description so it can't be tagged
    105 
    10698    }
    10799}
  • router/java/src/net/i2p/router/Router.java

    r87cad7e r8d42ebc  
    14221422    }
    14231423   
     1424    /**
     1425     *  Mark a string for extraction by xgettext and translation.
     1426     *  Use this only in static initializers.
     1427     *  It does not translate!
     1428     *  @return s
     1429     *  @since 0.8.7
     1430     */
     1431    private static final String _x(String s) {
     1432        return s;
     1433    }
     1434
    14241435/* following classes are now private static inner classes, didn't bother to reindent */
    14251436
     
    14361447    public CoalesceStatsEvent(RouterContext ctx) {
    14371448        _ctx = ctx;
    1438         ctx.statManager().createRequiredRateStat("bw.receiveBps", "Message receive rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
    1439         // used in the router watchdog
    1440         ctx.statManager().createRequiredRateStat("bw.sendBps", "Message send rate (Bytes/sec)", "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
    1441         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 });
    1442         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 });
    1443         ctx.statManager().createRequiredRateStat("router.activePeers", "How many peers we are actively talking with", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
     1449        // NOTE TO TRANSLATORS - each of these phrases is a description for a statistic
     1450        // to be displayed on /stats.jsp and in the graphs on /graphs.jsp.
     1451        // Please keep relatively short so it will fit on the graphs.
     1452        ctx.statManager().createRequiredRateStat("bw.receiveBps", _x("Message receive rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
     1453        ctx.statManager().createRequiredRateStat("bw.sendBps", _x("Message send rate (bytes/sec)"), "Bandwidth", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
     1454        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 });
     1455        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 });
     1456        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 });
    14441457        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 });
    14451458        ctx.statManager().createRateStat("router.highCapacityPeers", "How many high capacity peers we know", "Throttle", new long[] { 5*60*1000, 60*60*1000 });
    1446         ctx.statManager().createRequiredRateStat("router.fastPeers", "Known fast peers", "Throttle", new long[] { 5*60*1000, 60*60*1000 });
     1459        ctx.statManager().createRequiredRateStat("router.fastPeers", _x("Known fast peers"), "Throttle", new long[] { 5*60*1000, 60*60*1000 });
    14471460        _maxMemory = Runtime.getRuntime().maxMemory();
    14481461        String legend = "(Bytes)";
    14491462        if (_maxMemory < Long.MAX_VALUE)
    14501463            legend += " Max is " + DataHelper.formatSize(_maxMemory) + 'B';
     1464        // router.memoryUsed currently has the max size in the description so it can't be tagged
    14511465        ctx.statManager().createRequiredRateStat("router.memoryUsed", legend, "Router", new long[] { 60*1000 });
    14521466    }
Note: See TracChangeset for help on using the changeset viewer.