diff --git a/htroot/ConfigHTCache_p.html b/htroot/ConfigHTCache_p.html index ae8c851ce..890ae9845 100644 --- a/htroot/ConfigHTCache_p.html +++ b/htroot/ConfigHTCache_p.html @@ -19,7 +19,7 @@
-
#[actualCacheSize]# MB
+
#[actualCacheSize]# MB for #[actualCacheDocCount]# files, #[docSizeAverage]# KB / file in average
MB
 
diff --git a/htroot/ConfigHTCache_p.java b/htroot/ConfigHTCache_p.java index 73141e65a..48d4df623 100644 --- a/htroot/ConfigHTCache_p.java +++ b/htroot/ConfigHTCache_p.java @@ -77,7 +77,9 @@ public class ConfigHTCache_p { } prop.put("HTCachePath", env.getConfig(SwitchboardConstants.HTCACHE_PATH, SwitchboardConstants.HTCACHE_PATH_DEFAULT)); - prop.put("actualCacheSize", (Cache.getActualCacheSize() / 1024 / 1024)); + prop.put("actualCacheSize", Cache.getActualCacheSize() / 1024 / 1024); + prop.put("actualCacheDocCount", Cache.getActualCacheDocCount()); + prop.put("docSizeAverage", Cache.getActualCacheSize() / Cache.getActualCacheDocCount() / 1024); prop.put("maxCacheSize", env.getConfigLong(SwitchboardConstants.PROXY_CACHE_SIZE, 64)); // return rewrite properties return prop; diff --git a/source/net/yacy/crawler/data/Cache.java b/source/net/yacy/crawler/data/Cache.java index f1d72354f..9973f08a0 100644 --- a/source/net/yacy/crawler/data/Cache.java +++ b/source/net/yacy/crawler/data/Cache.java @@ -182,6 +182,14 @@ public final class Cache { public static long getActualCacheSize() { return fileDBunbuffered.length(); } + + /** + * get the current actual cache size + * @return + */ + public static long getActualCacheDocCount() { + return fileDBunbuffered.size(); + } /** * close the databases