Author: toad
Date: 2007-06-11 18:43:31 +0000 (Mon, 11 Jun 2007)
New Revision: 13517

Modified:
   trunk/freenet/src/freenet/io/comm/DMT.java
   trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
Log:
Include basic load information in UOMAnnounce.

Modified: trunk/freenet/src/freenet/io/comm/DMT.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/DMT.java  2007-06-11 17:59:32 UTC (rev 
13516)
+++ trunk/freenet/src/freenet/io/comm/DMT.java  2007-06-11 18:43:31 UTC (rev 
13517)
@@ -108,6 +108,8 @@
        public static final String REVOCATION_KEY_FILE_LENGTH = 
"revocationKeyFileLength";
        public static final String MAIN_JAR_FILE_LENGTH = "mainJarFileLength";
        public static final String EXTRA_JAR_FILE_LENGTH = "extraJarFileLength";
+       public static final String PING_TIME = "pingTime";
+       public static final String BWLIMIT_DELAY_TIME = "bwlimitDelayTime";

        //Diagnostic
        public static final MessageType ping = new MessageType("ping") {{
@@ -976,11 +978,13 @@
                addField(REVOCATION_KEY_FILE_LENGTH, Long.class);
                addField(MAIN_JAR_FILE_LENGTH, Long.class);
                addField(EXTRA_JAR_FILE_LENGTH, Long.class);
+               addField(PING_TIME, Integer.class);
+               addField(BWLIMIT_DELAY_TIME, Integer.class);
        }};

        public static final Message createUOMAnnounce(String mainKey, String 
extraKey, String revocationKey,
                        boolean haveRevocation, long mainJarVersion, long 
extraJarVersion, long timeLastTriedRevocationFetch,
-                       int revocationDNFCount, long revocationKeyLength, long 
mainJarLength, long extraJarLength) {
+                       int revocationDNFCount, long revocationKeyLength, long 
mainJarLength, long extraJarLength, int pingTime, int bwlimitDelayTime) {
                Message msg = new Message(UOMAnnounce);

                msg.set(MAIN_JAR_KEY, mainKey);
@@ -994,6 +998,8 @@
                msg.set(REVOCATION_KEY_FILE_LENGTH, revocationKeyLength);
                msg.set(MAIN_JAR_FILE_LENGTH, mainJarLength);
                msg.set(EXTRA_JAR_FILE_LENGTH, extraJarLength);
+               msg.set(PING_TIME, pingTime);
+               msg.set(BWLIMIT_DELAY_TIME, bwlimitDelayTime);

                return msg;
        }

Modified: trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java       
2007-06-11 17:59:32 UTC (rev 13516)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java       
2007-06-11 18:43:31 UTC (rev 13517)
@@ -155,7 +155,8 @@
                                revocationChecker.lastSucceeded(), 
revocationChecker.getRevocationDNFCounter(), 
                                revocationChecker.getBlobSize(), 
                                mainUpdater == null ? -1 : 
mainUpdater.getBlobSize(),
-                               extUpdater == null ? -1 : 
extUpdater.getBlobSize());
+                               extUpdater == null ? -1 : 
extUpdater.getBlobSize(), 
+                               (int)node.nodeStats.getNodeAveragePingTime(), 
(int)node.nodeStats.getBwlimitDelayTime());
        }

        /**


Reply via email to