Changeset 8dc1c4f


Ignore:
Timestamp:
Sep 7, 2011 1:36:52 AM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4b989eb
Parents:
8233c4f
Message:
  • Console: Limit max displayed participating tunnels
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java

    r8233c4f r8dc1c4f  
    3333public class TunnelRenderer {
    3434    private RouterContext _context;
     35
     36    private static final int DISPLAY_LIMIT = 200;
    3537   
    3638    public TunnelRenderer(RouterContext ctx) {
     
    7880            processed = (long)rs.getRate(10*60*1000).getLifetimeTotalValue();
    7981        int inactive = 0;
     82        int displayed = 0;
    8083        for (int i = 0; i < participating.size(); i++) {
    8184            HopConfig cfg = (HopConfig)participating.get(i);
    82             if (cfg.getProcessedMessagesCount() <= 0) {
     85            long count = cfg.getProcessedMessagesCount();
     86            if (count <= 0) {
    8387                inactive++;
    8488                continue;
    8589            }
     90            processed += count;
     91            if (++displayed > DISPLAY_LIMIT)
     92                continue;
    8693            out.write("<tr>");
    8794            if (cfg.getReceiveTunnel() != null)
     
    121128                out.write("<td class=\"cells\" align=\"center\">" + _("Participant") + "</td>");
    122129            out.write("</tr>\n");
    123             processed += cfg.getProcessedMessagesCount();
    124130        }
    125131        out.write("</table>\n");
     132        if (displayed > DISPLAY_LIMIT)
     133            out.write("<div class=\"statusnotes\"><b>" + _("Limited display to the {0} tunnels with the highest usage", DISPLAY_LIMIT)  + "</b></div>\n");
    126134        out.write("<div class=\"statusnotes\"><b>" + _("Inactive participating tunnels") + ": " + inactive + "</b></div>\n");
    127135        out.write("<div class=\"statusnotes\"><b>" + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B</b></div>\n");
     
    340348        return Messages.getString(s, _context);
    341349    }
     350
     351    /** translate a string */
     352    public String _(String s, Object o) {
     353        return Messages.getString(s, o, _context);
     354    }
    342355}
Note: See TracChangeset for help on using the changeset viewer.