diff --git a/htroot/xml/status_p.java b/htroot/xml/status_p.java index 43dbd3f11..a76997a87 100644 --- a/htroot/xml/status_p.java +++ b/htroot/xml/status_p.java @@ -43,7 +43,7 @@ public class status_p { sb.updateMySeed(); final int cacheOutSize = sb.webIndex.dhtOutCacheSize(); final long cacheMaxSize = sb.getConfigLong(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, 10000); - prop.putNum("ppm", sb.webIndex.seedDB.mySeed().getPPM()); + prop.putNum("ppm", sb.currentPPM()); prop.putNum("qpm", sb.webIndex.seedDB.mySeed().getQPM()); prop.putNum("wordCacheSize", sb.webIndex.dhtOutCacheSize() + sb.webIndex.dhtInCacheSize()); prop.putNum("wordCacheWSize", cacheOutSize); diff --git a/source/de/anomic/plasma/plasmaProfiling.java b/source/de/anomic/plasma/plasmaProfiling.java index 4695317a4..8d6b2bf77 100644 --- a/source/de/anomic/plasma/plasmaProfiling.java +++ b/source/de/anomic/plasma/plasmaProfiling.java @@ -53,6 +53,7 @@ public class plasmaProfiling { public static ymageMatrix performanceGraph(final int width, final int height, final String subline) { // find maximum values for automatic graph dimension adoption final int maxppm = (int) maxPayload("ppm", 25); + final int maxwords = (int) maxPayload("wordcache", 10000); final long maxbytes = maxPayload("memory", 110 * 1024 * 1024); // declare graph and set dimensions @@ -60,53 +61,73 @@ public class plasmaProfiling { final int rightborder = 30; final int topborder = 20; final int bottomborder = 20; - final int leftscale = 50; + final int leftscale = 20000; final int rightscale = 100; + final int anotscale = 50; final int bottomscale = 60; final int vspace = height - topborder - bottomborder; final int hspace = width - leftborder - rightborder; final int maxtime = 600; - ymageChart chart = new ymageChart(width, height, "FFFFFF", "000000", "AAAAAA", leftborder, rightborder, topborder, bottomborder, "PEER PERFORMANCE GRAPH: PAGES/MINUTE and USED MEMORY", subline); + ymageChart chart = new ymageChart(width, height, "FFFFFF", "000000", "AAAAAA", leftborder, rightborder, topborder, bottomborder, "YACY PEER PERFORMANCE: MAIN MEMORY, WORD CACHE AND PAGES/MINUTE (PPM)", subline); chart.declareDimension(ymageChart.DIMENSION_BOTTOM, bottomscale, hspace / (maxtime / bottomscale), -maxtime, "000000", "CCCCCC", "TIME/SECONDS"); - chart.declareDimension(ymageChart.DIMENSION_LEFT, leftscale, vspace * leftscale / maxppm, 0, "008800", null , "PPM [PAGES/MINUTE]"); + chart.declareDimension(ymageChart.DIMENSION_LEFT, leftscale, vspace * leftscale / maxwords, 0, "008800", null , "WORDS IN CACHE"); chart.declareDimension(ymageChart.DIMENSION_RIGHT, rightscale, vspace * rightscale / (int)(maxbytes / 1024 / 1024), 0, "0000FF", "CCCCCC", "MEMORY/MEGABYTE"); + chart.declareDimension(ymageChart.DIMENSION_ANOT, anotscale, vspace * anotscale / maxppm, 0, "008800", null , "PPM [PAGES/MINUTE]"); - // draw ppm - Iterator i = serverProfiling.history("ppm"); + // draw chart long time; final long now = System.currentTimeMillis(); long bytes; - int x0 = 1, x1, y0 = 0, y1, ppm; + int x0 = 1, x1, y0 = 0, y1, ppm, words; serverProfiling.Event event; try { + // draw memory + Iterator i = serverProfiling.history("memory"); while (i.hasNext()) { event = i.next(); time = event.time - now; - ppm = (int) ((Long) event.payload).longValue(); + bytes = ((Long) event.payload).longValue(); x1 = (int) (time/1000); - y1 = ppm; + y1 = (int) (bytes / 1024 / 1024); + chart.setColor("AAAAFF"); + chart.chartDot(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_RIGHT, x1, y1, 2, null); + chart.setColor("0000FF"); + if (x0 < 0) chart.chartLine(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_RIGHT, x0, y0, x1, y1); + x0 = x1; y0 = y1; + } + + // draw wordcache + i = serverProfiling.history("wordcache"); + x0 = 1; y0 = 0; + while (i.hasNext()) { + event = i.next(); + time = event.time - now; + words = (int) ((Long) event.payload).longValue(); + x1 = (int) (time/1000); + y1 = words; chart.setColor("228822"); - chart.chartDot(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_LEFT, x1, y1, 2); + chart.chartDot(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_LEFT, x1, y1, 2, null); chart.setColor("008800"); if (x0 < 0) chart.chartLine(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_LEFT, x0, y0, x1, y1); x0 = x1; y0 = y1; } - - // draw memory - i = serverProfiling.history("memory"); - x0 = 1; + + // draw ppm + i = serverProfiling.history("ppm"); + x0 = 1; y0 = 0; while (i.hasNext()) { event = i.next(); time = event.time - now; - bytes = ((Long) event.payload).longValue(); + ppm = (int) ((Long) event.payload).longValue(); x1 = (int) (time/1000); - y1 = (int) (bytes / 1024 / 1024); - chart.setColor("AAAAFF"); - chart.chartDot(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_RIGHT, x1, y1, 2); - chart.setColor("0000FF"); - if (x0 < 0) chart.chartLine(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_RIGHT, x0, y0, x1, y1); + y1 = ppm; + chart.setColor("AA8888"); + if (x0 < 0) chart.chartLine(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_ANOT, x0, y0, x1, y1); + chart.setColor("AA2222"); + chart.chartDot(ymageChart.DIMENSION_BOTTOM, ymageChart.DIMENSION_ANOT, x1, y1, 2, ppm + " PPM"); x0 = x1; y0 = y1; } + bufferChart = chart; } catch (final ConcurrentModificationException cme) { chart = bufferChart; diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 4eb342c47..fe0303973 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -1683,7 +1683,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch 30000) { // we don't want to do this too often updateMySeed(); - serverProfiling.update("ppm", new Long(webIndex.seedDB.mySeed().getPPM())); + serverProfiling.update("ppm", new Long(currentPPM())); + serverProfiling.update("wordcache", new Long(webIndex.cacheSize())); lastPPMUpdate = System.currentTimeMillis(); } serverProfiling.update("indexed", queueEntry.url().toNormalform(true, false)); @@ -2092,6 +2093,14 @@ public final class plasmaSwitchboard extends serverAbstractSwitch= 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(); ymageToolPrint.print(this, (left) ? leftborder - 4 : width - rightborder + 4, y, 0, s1, (left) ? 1 : -1); y -= pixelperscale; @@ -156,10 +158,10 @@ public class ymageChart extends ymageMatrix { ip.declareDimension(DIMENSION_LEFT, 50, 40, 0, green, scale , "PPM [PAGES/MINUTE]"); ip.declareDimension(DIMENSION_RIGHT, 100, 20, 0, blue, scale, "MEMORY/MEGABYTE"); ip.setColor(green); - ip.chartDot(DIMENSION_BOTTOM, DIMENSION_LEFT, -160, 100, 5); + ip.chartDot(DIMENSION_BOTTOM, DIMENSION_LEFT, -160, 100, 5, null); ip.chartLine(DIMENSION_BOTTOM, DIMENSION_LEFT, -160, 100, -130, 200); ip.setColor(blue); - ip.chartDot(DIMENSION_BOTTOM, DIMENSION_RIGHT, -50, 300, 2); + ip.chartDot(DIMENSION_BOTTOM, DIMENSION_RIGHT, -50, 300, 2, null); ip.chartLine(DIMENSION_BOTTOM, DIMENSION_RIGHT, -80, 100, -50, 300); //ip.print(100, 100, 0, "TEXT", true); //ip.print(100, 100, 0, "1234", false);