net.i2p.router.web
Class SummaryHelper

java.lang.Object
  extended by net.i2p.router.web.HelperBase
      extended by net.i2p.router.web.SummaryHelper

public class SummaryHelper
extends HelperBase

Simple helper to query the appropriate router for data necessary to render the summary sections on the router console.


Field Summary
 
Fields inherited from class net.i2p.router.web.HelperBase
_context, _out
 
Constructor Summary
SummaryHelper()
           
 
Method Summary
 boolean allowReseed()
          this displayed offset, not skew - now handled in reachability() private String timeSkew() { if (_context == null) return ""; //if (!
 java.lang.String getAction()
           
 int getActivePeers()
          How many peers we are talking to now
 int getActiveProfiles()
          How many active identities have we spoken with recently
 int getAllPeers()
          subtract one for ourselves, so if we know no other peers it displays zero
 java.lang.String getConsoleNonce()
           
 java.lang.String getDestinations()
          Client destinations connected locally.
 int getFastPeers()
          How many active peers the router ranks as fast.
 java.lang.String getFiveMinuteKBps()
           
 int getHighCapacityPeers()
          How many active peers the router ranks as having a high capacity.
 java.lang.String getIdent()
          Retrieve the shortened 4 character ident for the router located within the current JVM at the given context.
 java.lang.String getInboundBacklog()
           
 int getInboundClientTunnels()
          How many inbound client tunnels we have.
 java.lang.String getInboundTransferred()
          How much data have we received since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
 int getInboundTunnels()
          How many free inbound tunnels we have.
 java.lang.String getJobLag()
          How lagged our job queue is over the last minute (pretty printed with the units attached)
 java.lang.String getLifetimeKBps()
           
 java.lang.String getMessageDelay()
          How long it takes us to pump out a message, averaged over the last minute (pretty printed with the units attached)
 int getOutboundClientTunnels()
          How many active outbound client tunnels we have.
 java.lang.String getOutboundTransferred()
          How much data have we sent since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
 int getOutboundTunnels()
          How many active outbound tunnels we have.
 int getParticipatingTunnels()
          How many tunnels we are participating in.
 java.lang.String getReachability()
           
 java.lang.String getRequestURI()
           
 java.lang.String getSecondKBps()
           
 java.lang.String getShareRatio()
           
 java.lang.String getTunnelLag()
          How long it takes us to test our tunnels, averaged over the last 10 minutes (pretty printed with the units attached)
 java.lang.String getTunnelStatus()
           
 java.lang.String getUnsignedUpdateVersion()
           
 java.lang.String getUpdateNonce()
           
 java.lang.String getUpdateVersion()
           
 java.lang.String getUptime()
          Retrieve a pretty printed uptime count (ala 4d or 7h or 39m)
 java.lang.String getVersion()
          Retrieve the version number of the router.
 int getWellIntegratedPeers()
          How many active peers the router ranks as well integrated.
 void renderSummaryBar()
          output the summary bar to _out
 void setAction(java.lang.String s)
           
 void setConsoleNonce(java.lang.String s)
           
 void setRequestURI(java.lang.String s)
           
 void setUpdateNonce(java.lang.String s)
           
 boolean showFirewallWarning()
          Should we warn about a possible firewall problem?
 boolean unsignedUpdateAvailable()
           
 boolean updateAvailable()
          public String getPRNGStatus() { Rate r = _context.statManager().getRate("prng.bufferWaitTime").getRate(60*1000); int use = (int) r.getLastEventCount(); int i = (int) (r.getAverageValue() + 0.5); if (i <= 0) { r = _context.statManager().getRate("prng.bufferWaitTime").getRate(10*60*1000); i = (int) (r.getAverageValue() + 0.5); } String rv = i + "/"; r = _context.statManager().getRate("prng.bufferFillTime").getRate(60*1000); i = (int) (r.getAverageValue() + 0.5); if (i <= 0) { r = _context.statManager().getRate("prng.bufferFillTime").getRate(10*60*1000); i = (int) (r.getAverageValue() + 0.5); } rv = rv + i + "ms"; // margin == fill time / use time if (use > 0 && i > 0) rv = rv + ' ' + (60*1000 / (use * i)) + 'x'; return rv; }
 
Methods inherited from class net.i2p.router.web.HelperBase
_, _, _, _, _x, setContextId, setWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SummaryHelper

public SummaryHelper()
Method Detail

getIdent

public java.lang.String getIdent()
Retrieve the shortened 4 character ident for the router located within the current JVM at the given context.


getVersion

public java.lang.String getVersion()
Retrieve the version number of the router.


getUptime

public java.lang.String getUptime()
Retrieve a pretty printed uptime count (ala 4d or 7h or 39m)


allowReseed

public boolean allowReseed()
this displayed offset, not skew - now handled in reachability() private String timeSkew() { if (_context == null) return ""; //if (!_context.clock().getUpdatedSuccessfully()) // return " (Unknown skew)"; long ms = _context.clock().getOffset(); long diff = Math.abs(ms); if (diff < 3000) return ""; return " (" + DataHelper.formatDuration(diff) + " " + _("skew") + ")"; }


getAllPeers

public int getAllPeers()
subtract one for ourselves, so if we know no other peers it displays zero


getReachability

public java.lang.String getReachability()

getActivePeers

public int getActivePeers()
How many peers we are talking to now


showFirewallWarning

public boolean showFirewallWarning()
Should we warn about a possible firewall problem?


getActiveProfiles

public int getActiveProfiles()
How many active identities have we spoken with recently


getFastPeers

public int getFastPeers()
How many active peers the router ranks as fast.


getHighCapacityPeers

public int getHighCapacityPeers()
How many active peers the router ranks as having a high capacity.


getWellIntegratedPeers

public int getWellIntegratedPeers()
How many active peers the router ranks as well integrated.


getSecondKBps

public java.lang.String getSecondKBps()
Returns:
"x.xx / y.yy {K|M}"

getFiveMinuteKBps

public java.lang.String getFiveMinuteKBps()
Returns:
"x.xx / y.yy {K|M}"

getLifetimeKBps

public java.lang.String getLifetimeKBps()
Returns:
"x.xx / y.yy {K|M}"

getInboundTransferred

public java.lang.String getInboundTransferred()
How much data have we received since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)


getOutboundTransferred

public java.lang.String getOutboundTransferred()
How much data have we sent since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)


getDestinations

public java.lang.String getDestinations()
Client destinations connected locally.

Returns:
html section summary

getInboundTunnels

public int getInboundTunnels()
How many free inbound tunnels we have.


getOutboundTunnels

public int getOutboundTunnels()
How many active outbound tunnels we have.


getInboundClientTunnels

public int getInboundClientTunnels()
How many inbound client tunnels we have.


getOutboundClientTunnels

public int getOutboundClientTunnels()
How many active outbound client tunnels we have.


getParticipatingTunnels

public int getParticipatingTunnels()
How many tunnels we are participating in.


getShareRatio

public java.lang.String getShareRatio()
Since:
0.7.10

getJobLag

public java.lang.String getJobLag()
How lagged our job queue is over the last minute (pretty printed with the units attached)


getMessageDelay

public java.lang.String getMessageDelay()
How long it takes us to pump out a message, averaged over the last minute (pretty printed with the units attached)


getTunnelLag

public java.lang.String getTunnelLag()
How long it takes us to test our tunnels, averaged over the last 10 minutes (pretty printed with the units attached)


getTunnelStatus

public java.lang.String getTunnelStatus()

getInboundBacklog

public java.lang.String getInboundBacklog()

updateAvailable

public boolean updateAvailable()
public String getPRNGStatus() { Rate r = _context.statManager().getRate("prng.bufferWaitTime").getRate(60*1000); int use = (int) r.getLastEventCount(); int i = (int) (r.getAverageValue() + 0.5); if (i <= 0) { r = _context.statManager().getRate("prng.bufferWaitTime").getRate(10*60*1000); i = (int) (r.getAverageValue() + 0.5); } String rv = i + "/"; r = _context.statManager().getRate("prng.bufferFillTime").getRate(60*1000); i = (int) (r.getAverageValue() + 0.5); if (i <= 0) { r = _context.statManager().getRate("prng.bufferFillTime").getRate(10*60*1000); i = (int) (r.getAverageValue() + 0.5); } rv = rv + i + "ms"; // margin == fill time / use time if (use > 0 && i > 0) rv = rv + ' ' + (60*1000 / (use * i)) + 'x'; return rv; }


unsignedUpdateAvailable

public boolean unsignedUpdateAvailable()

getUpdateVersion

public java.lang.String getUpdateVersion()

getUnsignedUpdateVersion

public java.lang.String getUnsignedUpdateVersion()

renderSummaryBar

public void renderSummaryBar()
                      throws java.io.IOException
output the summary bar to _out

Throws:
java.io.IOException

setAction

public void setAction(java.lang.String s)

getAction

public java.lang.String getAction()

setConsoleNonce

public void setConsoleNonce(java.lang.String s)

getConsoleNonce

public java.lang.String getConsoleNonce()

setUpdateNonce

public void setUpdateNonce(java.lang.String s)

getUpdateNonce

public java.lang.String getUpdateNonce()

setRequestURI

public void setRequestURI(java.lang.String s)

getRequestURI

public java.lang.String getRequestURI()