diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index ec1d92469efad7d9e48667c249cedf90b411f5f7..05d28709acc071a55e574940135169877f229fe5 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -264,6 +264,12 @@ public class Router { buf.append("<li> ").append(sent).append(" bytes sent, "); buf.append(received).append(" bytes received</li>"); + long notSent = _context.bandwidthLimiter().getTotalWastedOutboundBytes(); + long notReceived = _context.bandwidthLimiter().getTotalWastedInboundBytes(); + + buf.append("<li> ").append(notSent).append(" bytes outbound bytes unused, "); + buf.append(notReceived).append(" bytes inbound bytes unused</li>"); + DecimalFormat fmt = new DecimalFormat("##0.00"); // we use the unadjusted time, since thats what getWhenStarted is based off @@ -276,7 +282,15 @@ public class Router { buf.append(fmt.format(sendKBps)).append("KBps sent "); buf.append(fmt.format(receivedKBps)).append("KBps received"); buf.append("</li>"); - } + } + if ( (notSent > 0) && (notReceived > 0) ) { + double notSendKBps = notSent / (lifetime*1024.0); + double notReceivedKBps = notReceived / (lifetime*1024.0); + buf.append("<li>Lifetime rate: "); + buf.append(fmt.format(notSendKBps)).append("KBps outbound unused "); + buf.append(fmt.format(notReceivedKBps)).append("KBps inbound unused"); + buf.append("</li>"); + } RateStat sendRate = _context.statManager().getRate("transport.sendMessageSize"); for (int i = 0; i < sendRate.getPeriods().length; i++) {