[freenet-cvs] r13288 - trunk/freenet/src/freenet/clients/http

juiceman at freenetproject.org juiceman at freenetproject.org
Mon May 21 01:09:05 UTC 2007


Author: juiceman
Date: 2007-05-21 01:09:05 +0000 (Mon, 21 May 2007)
New Revision: 13288

Modified:
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
Log:
Add a percentage

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java	2007-05-20 22:05:41 UTC (rev 13287)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java	2007-05-21 01:09:05 UTC (rev 13288)
@@ -362,8 +362,8 @@
 		long overallKeys = cachedKeys + storeKeys;
 		long overallSize = cachedSize + storeSize;
 
-//		long maxCachedKeys = node.getChkDatacache().getMaxKeys();
-//		long maxStoreKeys = node.getChkDatastore().getMaxKeys();
+		long maxCachedKeys = node.getChkDatacache().getMaxKeys();
+		long maxStoreKeys = node.getChkDatastore().getMaxKeys();
 		long maxOverallKeys = node.getMaxTotalKeys();
 		long maxOverallSize = maxOverallKeys * fix32kb;
 
@@ -379,12 +379,14 @@
 		// (It's a public static constant, so it will use the version from compile time of freenet.jar)
 
 		storeSizeList.addChild("li", 
-				"Cached keys:\u00a0" + thousendPoint.format(cachedKeys) + 
-				" (" + SizeUtil.formatSize(cachedSize, true) + ')');
+				"Cached keys: " + thousendPoint.format(cachedKeys) + 
+				" (" + SizeUtil.formatSize(cachedSize, true) + ')' +
+				" (" + ((cachedKeys*100)/maxCachedKeys) + "%)");
 
 		storeSizeList.addChild("li", 
 				"Stored keys:\u00a0" + thousendPoint.format(storeKeys) + 
-				" (" + SizeUtil.formatSize(storeSize, true) + ')');
+				" (" + SizeUtil.formatSize(storeSize, true) + ')' +
+				" (" + ((storeKeys*100)/maxStoreKeys) + "%)");
 
 		storeSizeList.addChild("li", 
 				"Overall size:\u00a0" + thousendPoint.format(overallKeys) + 




More information about the cvs mailing list