diff options
Diffstat (limited to 'htroot/ConfigHTCache_p.java')
| -rw-r--r-- | htroot/ConfigHTCache_p.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/htroot/ConfigHTCache_p.java b/htroot/ConfigHTCache_p.java index 88baf9c95..827dab17a 100644 --- a/htroot/ConfigHTCache_p.java +++ b/htroot/ConfigHTCache_p.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; +import java.text.NumberFormat; import java.util.zip.Deflater; import net.yacy.cora.protocol.RequestHeader; @@ -117,6 +118,13 @@ public class ConfigHTCache_p { prop.put("actualCacheDocCount", Cache.getActualCacheDocCount()); prop.put("docSizeAverage", Cache.getActualCacheDocCount() == 0 ? 0 : Cache.getActualCacheSize() / Cache.getActualCacheDocCount() / 1024); prop.put("maxCacheSize", env.getConfigLong(SwitchboardConstants.PROXY_CACHE_SIZE, 64)); + /* Statistics */ + final long hits = Cache.getHits(); + final long totalRequests = Cache.getTotalRequests(); + prop.put("hits", hits); + prop.put("requests", totalRequests); + prop.put("hitRate", NumberFormat.getPercentInstance().format(Cache.getHitRate())); + // return rewrite properties return prop; } |
