summaryrefslogtreecommitdiff
path: root/htroot
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-05-06 22:03:09 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-05-06 22:03:09 +0000
commitdca85b82ff298c86d80ad00fb46afd12af439b72 (patch)
tree5615d1ef410dd800f039193fbb3d257a05e372e0 /htroot
parentd6480dc670a67310ed0ca2daeea69868047ebd48 (diff)
fix for wrong memory display
see http://www.yacy-forum.de/viewtopic.php?p=35239#35239 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3673 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
-rw-r--r--htroot/PerformanceMemory_p.html8
-rw-r--r--htroot/PerformanceMemory_p.java12
2 files changed, 12 insertions, 8 deletions
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html
index 3c44b8b34..25b6086b9 100644
--- a/htroot/PerformanceMemory_p.html
+++ b/htroot/PerformanceMemory_p.html
@@ -84,7 +84,7 @@
<td align="left" class="TableCellDark">#[tableIndexPath]#</td>
<td align="right">#[tableIndexChunkSize]#</td>
<td align="right">#[tableIndexCount]#</td>
- <td align="right">#[tableIndexMem]# MB</td>
+ <td align="right">#[tableIndexMem]#</td>
</tr>
#{/TableList}#
<tr class="TableCellDark">
@@ -111,7 +111,7 @@
<td align="left" class="TableCellDark">#[nodeCachePath]#</td>
<td align="right">#[nodeChunkSize]#</td>
<td align="right">#[nodeCacheCount]#</td>
- <td align="right">#[nodeCacheMem]# MB</td>
+ <td align="right">#[nodeCacheMem]#</td>
<td align="right">#[nodeCacheReadHit]#</td>
<td align="right">#[nodeCacheReadMiss]#</td>
<td align="right">#[nodeCacheWriteUnique]#</td>
@@ -158,7 +158,7 @@
<td align="left" class="TableCellDark">#[objectCachePath]#</td>
<td align="right">#[objectHitChunkSize]#</td>
<td align="right">#[objectHitCacheCount]#</td>
- <td align="right">#[objectHitCacheMem]# MB</td>
+ <td align="right">#[objectHitCacheMem]#</td>
<td align="right">#[objectHitCacheReadHit]#</td>
<td align="right">#[objectHitCacheReadMiss]#</td>
<td align="right">#[objectHitCacheWriteUnique]#</td>
@@ -167,7 +167,7 @@
<td align="right">#[objectHitCacheFlushes]#</td>
<td align="right">#[objectMissChunkSize]#</td>
<td align="right">#[objectMissCacheCount]#</td>
- <td align="right">#[objectMissCacheMem]# MB</td>
+ <td align="right">#[objectMissCacheMem]#</td>
<td align="right">#[objectMissCacheReadHit]#</td>
<td align="right">#[objectMissCacheReadMiss]#</td>
<td align="right">#[objectMissCacheWriteUnique]#</td>
diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.java
index c92320150..bc852ada9 100644
--- a/htroot/PerformanceMemory_p.java
+++ b/htroot/PerformanceMemory_p.java
@@ -129,7 +129,7 @@ public class PerformanceMemory_p {
prop.put("TableList_" + c + "_tableIndexPath", ((p = filename.indexOf("DATA")) < 0) ? filename : filename.substring(p));
prop.put("TableList_" + c + "_tableIndexChunkSize", map.get("tableIndexChunkSize"));
prop.put("TableList_" + c + "_tableIndexCount", map.get("tableIndexCount"));
- prop.put("TableList_" + c + "_tableIndexMem", map.get("tableIndexCount"));
+ prop.put("TableList_" + c + "_tableIndexMem", memstr(mem));
c++;
}
prop.put("TableList", c);
@@ -147,7 +147,7 @@ public class PerformanceMemory_p {
prop.put("NodeList_" + c + "_nodeCachePath", ((p = filename.indexOf("DATA")) < 0) ? filename : filename.substring(p));
prop.put("NodeList_" + c + "_nodeChunkSize", map.get("nodeChunkSize"));
prop.put("NodeList_" + c + "_nodeCacheCount", map.get("nodeCacheCount"));
- prop.put("NodeList_" + c + "_nodeCacheMem", mem / (1024 * 1024));
+ prop.put("NodeList_" + c + "_nodeCacheMem", memstr(mem));
prop.put("NodeList_" + c + "_nodeCacheReadHit", map.get("nodeCacheReadHit"));
prop.put("NodeList_" + c + "_nodeCacheReadMiss", map.get("nodeCacheReadMiss"));
prop.put("NodeList_" + c + "_nodeCacheWriteUnique", map.get("nodeCacheWriteUnique"));
@@ -175,7 +175,7 @@ public class PerformanceMemory_p {
totalhitmem += hitmem;
prop.put("ObjectList_" + c + "_objectHitChunkSize", map.get("objectHitChunkSize"));
prop.put("ObjectList_" + c + "_objectHitCacheCount", map.get("objectHitCacheCount"));
- prop.put("ObjectList_" + c + "_objectHitCacheMem", hitmem / (1024 * 1024));
+ prop.put("ObjectList_" + c + "_objectHitCacheMem", memstr(hitmem));
prop.put("ObjectList_" + c + "_objectHitCacheReadHit", map.get("objectHitCacheReadHit"));
prop.put("ObjectList_" + c + "_objectHitCacheReadMiss", map.get("objectHitCacheReadMiss"));
prop.put("ObjectList_" + c + "_objectHitCacheWriteUnique", map.get("objectHitCacheWriteUnique"));
@@ -188,7 +188,7 @@ public class PerformanceMemory_p {
totalmissmem += missmem;
prop.put("ObjectList_" + c + "_objectMissChunkSize", map.get("objectMissChunkSize"));
prop.put("ObjectList_" + c + "_objectMissCacheCount", map.get("objectMissCacheCount"));
- prop.put("ObjectList_" + c + "_objectMissCacheMem", missmem / (1024 * 1024));
+ prop.put("ObjectList_" + c + "_objectMissCacheMem", memstr(missmem));
prop.put("ObjectList_" + c + "_objectMissCacheReadHit", map.get("objectMissCacheReadHit"));
prop.put("ObjectList_" + c + "_objectMissCacheReadMiss", map.get("objectMissCacheReadMiss"));
prop.put("ObjectList_" + c + "_objectMissCacheWriteUnique", map.get("objectMissCacheWriteUnique"));
@@ -220,4 +220,8 @@ public class PerformanceMemory_p {
// return rewrite values for templates
return prop;
}
+
+ private static final String memstr(long mem) {
+ return (mem == 0) ? "-" : ((mem < 1024*1024) ? ((mem / 1024) + " KB") : (mem / (1024 * 1024) + " MB"));
+ }
}