fixed "Size in KBytes" calculation in PerformanceQueues_p.html,

see http://bugs.yacy.net/view.php?id=362
pull/1/head
Michael Peter Christen 11 years ago
parent 726e8c3ad5
commit 94245ce0a8

@ -289,7 +289,7 @@ public class PerformanceQueues_p {
// table cache settings
prop.putNum("wordCacheSize", indexSegment.RWIBufferCount());
prop.putNum("wordCacheSizeKBytes", rwi == null ? 0 : rwi.getBufferSizeBytes()/1024);
prop.putNum("wordCacheSizeKBytes", rwi == null ? 0 : rwi.getBufferSizeBytes() / 1024L);
prop.putNum("maxURLinCache", rwi == null ? 0 : rwi.getBufferMaxReferences());
prop.putNum("maxAgeOfCache", rwi == null ? 0 : rwi.getBufferMaxAge() / 1000 / 60); // minutes
prop.putNum("minAgeOfCache", rwi == null ? 0 : rwi.getBufferMinAge() / 1000 / 60); // minutes

@ -44,6 +44,10 @@ public class ByteArray {
public ByteArray(final byte[] bb) {
this.buffer = bb;
}
public long usedMemory() {
return this.buffer.length;
}
public byte[] asBytes() {
return this.buffer;

@ -631,7 +631,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
@Override
public long getBufferSizeBytes() {
return 10000 * this.ram.size(); // guessed; we don't know that exactly because there is no statistics here (expensive, not necessary)
return this.ram.usedMemory();
}
@Override

@ -201,6 +201,16 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
public int size() {
return (this.cache == null) ? 0 : this.cache.size();
}
public long usedMemory() {
if (this.cache == null) return 0;
long b = 0L;
for (Map.Entry<ByteArray, ReferenceContainer<ReferenceType>> e: this.cache.entrySet()) {
b += e.getKey().usedMemory();
b += e.getValue().mem();
}
return b;
}
public boolean isEmpty() {
if (this.cache == null) return true;

Loading…
Cancel
Save