Author: toad
Date: 2008-02-27 21:36:30 +0000 (Wed, 27 Feb 2008)
New Revision: 18191

Modified:
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
   trunk/freenet/src/freenet/node/NodeStats.java
Log:
Show bytes used by connection auth

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-02-27 21:20:14 UTC (rev 18190)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-02-27 21:36:30 UTC (rev 18191)
@@ -808,6 +808,7 @@
                        activityList.addChild("li", l10n("insertOutput", new 
String[] { "chk", "ssk" }, new String[] { 
SizeUtil.formatSize(node.nodeStats.getCHKInsertTotalBytesSent(), true), 
SizeUtil.formatSize(node.nodeStats.getSSKInsertTotalBytesSent(), true) }));
                        activityList.addChild("li", l10n("offeredKeyOutput", 
"total", SizeUtil.formatSize(node.nodeStats.getOfferedKeysTotalBytesSent(), 
true)));
                        activityList.addChild("li", l10n("swapOutput", "total", 
SizeUtil.formatSize(node.nodeStats.getSwappingTotalBytesSent(), true)));
+                       activityList.addChild("li", l10n("authBytes", "total", 
SizeUtil.formatSize(node.nodeStats.getTotalAuthBytesSent(), true)));
                }
        }


Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-02-27 
21:20:14 UTC (rev 18190)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-02-27 
21:36:30 UTC (rev 18191)
@@ -965,6 +965,7 @@
 StatisticsToadlet.activityInserts=Inserts: ${totalSenders} total senders, 
${CHKhandlers} CHK handlers, ${SSKhandlers} SSK handlers
 StatisticsToadlet.activityRequests=Requests: ${totalSenders} total senders, 
${CHKhandlers} CHK handlers, ${SSKhandlers} SSK handlers
 StatisticsToadlet.allocMemory=Allocated Java memory: ${memory}
+StatisticsToadlet.authBytes=Connection setup: ${total} output
 StatisticsToadlet.bandwidthTitle=Bandwidth
 StatisticsToadlet.cpus=Available CPUs: ${count}
 StatisticsToadlet.fullTitle=Statistics for ${name}

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-02-27 
21:20:14 UTC (rev 18190)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-02-27 
21:36:30 UTC (rev 18191)
@@ -1632,6 +1632,7 @@
                byte[] random = new byte[paddingLength];
                node.fastWeakRandom.nextBytes(random);
                System.arraycopy(random, 0, data, 
hash.length+iv.length+2+output.length, random.length);
+               node.nodeStats.reportAuthBytes(data.length + 
sock.getHeadersLength());
                try {
                        sendPacket(data, replyTo, pn, 0);
                } catch (LocalAddressException e) {

Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java       2008-02-27 21:20:14 UTC 
(rev 18190)
+++ trunk/freenet/src/freenet/node/NodeStats.java       2008-02-27 21:36:30 UTC 
(rev 18191)
@@ -1125,5 +1125,15 @@
        public long getSwappingTotalBytesSent() {
                return swappingSentBytes;
        }
+
+       private long totalAuthBytesSent;

+       public synchronized void reportAuthBytes(int x) {
+               totalAuthBytesSent += x;
+       }
+       
+       public long getTotalAuthBytesSent() {
+               return totalAuthBytesSent;
+       }
+       
 }


Reply via email to