because newbies are scared about the memory consumption in the performance graph and arguments about high memory consumption according to bad knowledge about java garbage collection techniques, the memory display had been removed from the performance graph shown on the Status.html page. The memory graph can still be seen on the Performance page where the memory graph is just like it was.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7836 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 09bb7a390c
commit 3a191cdf14

@ -40,8 +40,9 @@ public class PerformanceGraph {
final int width = post.getInt("width", 660);
final int height = post.getInt("height", 240);
final boolean showMemory = !post.containsKey("nomem");
return ProfilingGraph.performanceGraph(width, height, sb.indexSegments.URLCount() + " URLS / " + sb.indexSegments.RWICount() + " WORDS IN INDEX / " + sb.indexSegments.RWIBufferCount() + " WORDS IN CACHE");
return ProfilingGraph.performanceGraph(width, height, sb.indexSegments.URLCount() + " URLS / " + sb.indexSegments.RWICount() + " WORDS IN INDEX / " + sb.indexSegments.RWIBufferCount() + " WORDS IN CACHE", showMemory);
}
}

@ -15,7 +15,7 @@
}
}
function reloadGraph() {
document.images["graph"].src="PerformanceGraph.png?time="+(new Date()).getTime();
document.images["graph"].src="PerformanceGraph.png?nomem=&time="+(new Date()).getTime();
window.status="";
}
function init() {
@ -47,7 +47,7 @@
<h2><img src="/env/grafics/kaskelix.png" width="128" height="64" alt="YaCy Websearch" style="margin-right:5px; vertical-align:middle;" />Welcome to YaCy!</h2>
<iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING,DHTRECEIVE,DHTSEND,PROXY&amp;width=600px&amp;height=180px&amp;maxlines=20&amp;maxwidth=120"
style="width:600px;height:180px;margin:0px;border:1px solid black;" scrolling="no" name="newsframe"></iframe><br />
<img src="PerformanceGraph.png" id="graph" alt="PerformanceGraph" width="660" height="240"/><br />
<img src="PerformanceGraph.png?nomem=" id="graph" alt="PerformanceGraph" width="660" height="240"/><br />
<img src="Banner.png?textcolor=000000&amp;bgcolor=e7effc&amp;bordercolor=5090d0" alt="banner" width="468" height="60"/>
</div>

@ -102,6 +102,7 @@ public class SearchEventCache {
private static SearchEvent dummyEvent = null;
private static SearchEvent getDummyEvent(final WorkTables workTables, final LoaderDispatcher loader, final Segment indexSegment) {
Log.logWarning("SearchEventCache", "returning dummy event");
if (dummyEvent != null) return dummyEvent;
final QueryParams query = new QueryParams("", 0, null, indexSegment, new RankingProfile(ContentDomain.TEXT), "");
dummyEvent = new SearchEvent(query, null, workTables, null, false, loader, 0, 0, 0, 0, false);

@ -29,12 +29,11 @@ package de.anomic.yacy.graphics;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import de.anomic.search.SearchEvent;
import net.yacy.kelondro.util.EventTracker;
import net.yacy.kelondro.util.EventTracker.Event;
import net.yacy.visualization.RasterPlotter;
import net.yacy.visualization.ChartPlotter;
import net.yacy.visualization.RasterPlotter;
import de.anomic.search.SearchEvent;
public class ProfilingGraph {
@ -56,7 +55,7 @@ public class ProfilingGraph {
return max;
}
public static RasterPlotter performanceGraph(final int width, final int height, final String subline) {
public static RasterPlotter performanceGraph(final int width, final int height, final String subline, final boolean showMemory) {
// find maximum values for automatic graph dimension adoption
final int maxppm = (int) maxPayload(EventTracker.EClass.PPM, 25);
final int maxwords = (int) maxPayload(EventTracker.EClass.WORDCACHE, 12000);
@ -68,8 +67,8 @@ public class ProfilingGraph {
final int rightborder = 30;
final int topborder = 20;
final int bottomborder = 20;
final int leftscale; if(maxwords > 150000) leftscale = maxwords / 150000 * 20000; else leftscale = 10000;
final int rightscale; if (maxmbytes > 1500) rightscale = maxmbytes / 1500 * 200; else rightscale = 100;
final int leftscale = (maxwords > 150000) ? maxwords / 150000 * 20000 : 10000;
final int rightscale = showMemory ? ((maxmbytes > 1500) ? maxmbytes / 1500 * 200 : 100) : Math.max(100, maxppm / 100 * 100);
final int anotscale = 1000;
final int bottomscale = 60;
final int vspace = height - topborder - bottomborder;
@ -77,8 +76,12 @@ public class ProfilingGraph {
final int maxtime = 600;
ChartPlotter chart = new ChartPlotter(width, height, "FFFFFF", "000000", "AAAAAA", leftborder, rightborder, topborder, bottomborder, "YACY PEER PERFORMANCE: MAIN MEMORY, WORD CACHE AND PAGES/MINUTE (PPM)", subline);
chart.declareDimension(ChartPlotter.DIMENSION_BOTTOM, bottomscale, hspace / (maxtime / bottomscale), -maxtime, "000000", "CCCCCC", "TIME/SECONDS");
chart.declareDimension(ChartPlotter.DIMENSION_LEFT, leftscale, vspace * leftscale / maxwords, 0, "008800", null , "INDEXING, WORDS IN CACHE");
chart.declareDimension(ChartPlotter.DIMENSION_LEFT, leftscale, vspace * leftscale / maxwords, 0, "008800", null , "WORDS IN INDEXING CACHE");
if (showMemory) {
chart.declareDimension(ChartPlotter.DIMENSION_RIGHT, rightscale, vspace * rightscale / maxmbytes, 0, "0000FF", "CCCCCC", "MEMORY/MEGABYTE");
} else {
chart.declareDimension(ChartPlotter.DIMENSION_RIGHT, rightscale, vspace * rightscale / Math.max(1, maxppm), 0, "FF0000", "CCCCCC", "INDEXING SPEED/PAGES PER MINUTE");
}
chart.declareDimension(ChartPlotter.DIMENSION_ANOT0, anotscale, vspace * anotscale / maxppm, 0, "008800", null , "PPM [PAGES/MINUTE]");
chart.declareDimension(ChartPlotter.DIMENSION_ANOT1, vspace / 6, vspace / 6, 0, "888800", null , "URL");
@ -104,8 +107,10 @@ public class ProfilingGraph {
x0 = x1; y0 = y1;
}
*/
Iterator<Event> events;
// draw memory
Iterator<Event> events = EventTracker.getHistory(EventTracker.EClass.MEMORY);
if (showMemory) {
events = EventTracker.getHistory(EventTracker.EClass.MEMORY);
x0 = 1; y0 = 0;
if (events != null) {
EventTracker.Event event;
@ -122,6 +127,7 @@ public class ProfilingGraph {
x0 = x1; y0 = y1;
}
}
}
// draw wordcache
events = EventTracker.getHistory(EventTracker.EClass.WORDCACHE);
@ -176,7 +182,7 @@ public class ProfilingGraph {
public long duration;
public int resultCount;
public searchEvent(final String queryID, final SearchEvent.Type processName, String comment, final int resultCount, final long duration) {
public searchEvent(final String queryID, final SearchEvent.Type processName, final String comment, final int resultCount, final long duration) {
this.queryID = queryID;
this.processName = processName;
this.comment = comment;

@ -41,16 +41,16 @@ public class ChartPlotter extends RasterPlotter {
public static final int DIMENSION_ANOT0 = 4;
public static final int DIMENSION_ANOT1 = 5;
private int leftborder;
private int rightborder;
private int topborder;
private int bottomborder;
private int[] scales = new int[]{0,0,0,0,0,0};
private int[] pixels = new int[]{0,0,0,0,0,0};
private int[] offsets = new int[]{0,0,0,0,0,0};
private String[] colnames = new String[]{"FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF"};
private String[] colscale = new String[]{null,null,null,null,null,null};
private String[] tablenames = new String[]{"","","","","",""};
private final int leftborder;
private final int rightborder;
private final int topborder;
private final int bottomborder;
private final int[] scales = new int[]{0,0,0,0,0,0};
private final int[] pixels = new int[]{0,0,0,0,0,0};
private final int[] offsets = new int[]{0,0,0,0,0,0};
private final String[] colnames = new String[]{"FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF"};
private final String[] colscale = new String[]{null,null,null,null,null,null};
private final String[] tablenames = new String[]{"","","","","",""};
public ChartPlotter(final int width, final int height, final String backgroundColor, final String foregroundColor, final String lightColor,
final int leftborder, final int rightborder, final int topborder, final int bottomborder,
@ -80,38 +80,38 @@ public class ChartPlotter extends RasterPlotter {
if ((dimensionType == DIMENSION_TOP) || (dimensionType == DIMENSION_BOTTOM)) {
drawHorizontalScale((dimensionType == DIMENSION_TOP), scale, pixelperscale, offset, colorNaming, colorScale, name);
}
scales[dimensionType] = scale;
pixels[dimensionType] = pixelperscale;
offsets[dimensionType] = offset;
colnames[dimensionType] = colorNaming;
colscale[dimensionType] = colorScale;
tablenames[dimensionType] = name;
this.scales[dimensionType] = scale;
this.pixels[dimensionType] = pixelperscale;
this.offsets[dimensionType] = offset;
this.colnames[dimensionType] = colorNaming;
this.colscale[dimensionType] = colorScale;
this.tablenames[dimensionType] = name;
}
public void chartDot(final int dimension_x, final int dimension_y, final int coord_x, final int coord_y, final int dotsize, String anot, int anotAngle) {
final int x = (coord_x - offsets[dimension_x]) * pixels[dimension_x] / scales[dimension_x];
final int y = (coord_y - offsets[dimension_y]) * pixels[dimension_y] / scales[dimension_y];
if (dotsize == 1) plot(leftborder + x, height - bottomborder - y, 100);
else dot(leftborder + x, height - bottomborder - y, dotsize, true, 100);
if (anot != null) PrintTool.print(this, leftborder + x + dotsize + 2 + ((anotAngle == 315) ? -9 : 0), height - bottomborder - y + ((anotAngle == 315) ? -3 : 0), anotAngle, anot, (anotAngle == 0) ? -1 : ((anotAngle == 315) ? 1 : 0));
public void chartDot(final int dimension_x, final int dimension_y, final int coord_x, final int coord_y, final int dotsize, final String anot, final int anotAngle) {
final int x = (coord_x - this.offsets[dimension_x]) * this.pixels[dimension_x] / this.scales[dimension_x];
final int y = (coord_y - this.offsets[dimension_y]) * this.pixels[dimension_y] / this.scales[dimension_y];
if (dotsize == 1) plot(this.leftborder + x, this.height - this.bottomborder - y, 100);
else dot(this.leftborder + x, this.height - this.bottomborder - y, dotsize, true, 100);
if (anot != null) PrintTool.print(this, this.leftborder + x + dotsize + 2 + ((anotAngle == 315) ? -9 : 0), this.height - this.bottomborder - y + ((anotAngle == 315) ? -3 : 0), anotAngle, anot, (anotAngle == 0) ? -1 : ((anotAngle == 315) ? 1 : 0));
}
public void chartLine(final int dimension_x, final int dimension_y, final int coord_x1, final int coord_y1, final int coord_x2, final int coord_y2) {
final int x1 = (coord_x1 - offsets[dimension_x]) * pixels[dimension_x] / scales[dimension_x];
final int y1 = (coord_y1 - offsets[dimension_y]) * pixels[dimension_y] / scales[dimension_y];
final int x2 = (coord_x2 - offsets[dimension_x]) * pixels[dimension_x] / scales[dimension_x];
final int y2 = (coord_y2 - offsets[dimension_y]) * pixels[dimension_y] / scales[dimension_y];
line(leftborder + x1, height - bottomborder - y1, leftborder + x2, height - bottomborder - y2, 100);
final int x1 = (coord_x1 - this.offsets[dimension_x]) * this.pixels[dimension_x] / this.scales[dimension_x];
final int y1 = (coord_y1 - this.offsets[dimension_y]) * this.pixels[dimension_y] / this.scales[dimension_y];
final int x2 = (coord_x2 - this.offsets[dimension_x]) * this.pixels[dimension_x] / this.scales[dimension_x];
final int y2 = (coord_y2 - this.offsets[dimension_y]) * this.pixels[dimension_y] / this.scales[dimension_y];
line(this.leftborder + x1, this.height - this.bottomborder - y1, this.leftborder + x2, this.height - this.bottomborder - y2, 100);
}
private void drawHorizontalScale(final boolean top, final int scale, final int pixelperscale, final int offset, final String colorNaming, final String colorScale, final String name) {
final int y = (top) ? topborder : height - bottomborder;
int x = leftborder;
final int y = (top) ? this.topborder : this.height - this.bottomborder;
int x = this.leftborder;
int s = offset;
while (x < width - rightborder) {
if ((colorScale != null) && (x > leftborder) && (x < (width - rightborder))) {
while (x < this.width - this.rightborder) {
if ((colorScale != null) && (x > this.leftborder) && (x < (this.width - this.rightborder))) {
setColor(colorScale);
line(x, topborder, x, height - bottomborder, 100);
line(x, this.topborder, x, this.height - this.bottomborder, 100);
}
setColor(colorNaming);
line(x, y - 3, x, y + 3, 100);
@ -120,32 +120,34 @@ public class ChartPlotter extends RasterPlotter {
s += scale;
}
setColor(colorNaming);
PrintTool.print(this, width - rightborder, (top) ? y - 9 : y + 15, 0, name, 1);
line(leftborder - 4, y, width - rightborder + 4, y, 100);
PrintTool.print(this, this.width - this.rightborder, (top) ? y - 9 : y + 15, 0, name, 1);
line(this.leftborder - 4, y, this.width - this.rightborder + 4, y, 100);
}
private void drawVerticalScale(final boolean left, final int scale, final int pixelperscale, final int offset, final String colorNaming, final String colorScale, final String name) {
final int x = (left) ? leftborder : width - rightborder;
int y = height - bottomborder;
assert pixelperscale > 0;
assert scale > 0;
final int x = (left) ? this.leftborder : this.width - this.rightborder;
int y = this.height - this.bottomborder;
int s = offset;
String s1;
int s1max = 0;
while (y > topborder) {
if ((colorScale != null) && (y > topborder) && (y < (height - bottomborder))) {
while (y > this.topborder) {
if ((colorScale != null) && (y > this.topborder) && (y < (this.height - this.bottomborder))) {
setColor(colorScale);
line(leftborder, y, width - rightborder, y, 100);
line(this.leftborder, y, this.width - this.rightborder, y, 100);
}
setColor(colorNaming);
line(x - 3, y, x + 3, y, 100);
s1 = (s >= 1000000 && s % 10000 == 0) ? Integer.toString(s / 1000000) + "M" : (s >= 1000 && s % 1000 == 0) ? Integer.toString(s / 1000) + "K" : Integer.toString(s);
if (s1.length() > s1max) s1max = s1.length();
PrintTool.print(this, (left) ? leftborder - 4 : width - rightborder + 4, y, 0, s1, (left) ? 1 : -1);
PrintTool.print(this, (left) ? this.leftborder - 4 : this.width - this.rightborder + 4, y, 0, s1, (left) ? 1 : -1);
y -= pixelperscale;
s += scale;
}
setColor(colorNaming);
PrintTool.print(this, (left) ? x - s1max * 6 - 6 : x + s1max * 6 + 9, topborder, 90, name, 1);
line(x, topborder - 4, x, height - bottomborder + 4, 100);
PrintTool.print(this, (left) ? x - s1max * 6 - 6 : x + s1max * 6 + 9, this.topborder, 90, name, 1);
line(x, this.topborder - 4, x, this.height - this.bottomborder + 4, 100);
}
public static void main(final String[] args) {

Loading…
Cancel
Save