http://localhost:8080/PerformanceConcurrency_p.html - used the new monitoring to do some fine-tuning of the indexing queue git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5402 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
449e697436
commit
e34ac22fbd
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>YaCy '#[clientname]#': Performance of Concurrent Processes</title>
|
||||
#%env/templates/metas.template%#
|
||||
<script type="text/javascript" src="js/html.js"></script>
|
||||
<meta http-equiv="REFRESH" content="1; url=/PerformanceConcurrency_p.html">
|
||||
</head>
|
||||
<body id="PerformanceConcurrency">
|
||||
#%env/templates/header.template%#
|
||||
#%env/templates/submenuConfig.template%#
|
||||
<h2>Performance of Concurrent Processes</h2>
|
||||
|
||||
<fieldset><legend>serverProcessor Objects</legend>
|
||||
<table border="0" cellpadding="2" cellspacing="1">
|
||||
<tr class="TableHeader" valign="bottom">
|
||||
<td>Thread</td>
|
||||
<td>Queue Size<br />Current</td>
|
||||
<td>Queue Size<br />Maximum</td>
|
||||
<td>Concurrency:<br />Number of Threads</td>
|
||||
<td>Childs</td>
|
||||
<td colspan="2">Average<br />Block Time<br />Reading</td>
|
||||
<td colspan="2">Average<br />Exec Time</td>
|
||||
<td colspan="2">Average<br />Block Time<br />Writing</td>
|
||||
<td>Total<br />Cycles</td>
|
||||
<td>Full Description</td>
|
||||
</tr>
|
||||
#{table}#
|
||||
<tr #(class)#class="TableCellLight"::class="TableCellDark"::class="TableCellSummary"#(/class)#>
|
||||
<td align="left">#[threadname]#</td>
|
||||
<td align="right">#[queuesize]#</td>
|
||||
<td align="right">#[queuesizemax]#</td>
|
||||
<td align="right">#[concurrency]#</td>
|
||||
<td align="right">#[childs]#</td>
|
||||
<td align="right">#[blockreadtime]# ms</td>
|
||||
<td align="right">#[blockreadpercent]#%</td>
|
||||
<td align="right">#[exectime]# ms</td>
|
||||
<td align="right">#[execpercent]#%</td>
|
||||
<td align="right">#[blockwritetime]# ms</td>
|
||||
<td align="right">#[blockwritepercent]#%</td>
|
||||
<td align="right">#[totalcycles]#</td>
|
||||
<td align="left">#[longdescr]#</td>
|
||||
</tr>
|
||||
#{/table}#
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
#%env/templates/footer.template%#
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,93 @@
|
||||
// PerformanceConcurrency_p.java
|
||||
// -----------------------
|
||||
// part of YaCy
|
||||
// (C) by Michael Peter Christen; mc@yacy.net
|
||||
// first published on http:// www.yacy.net
|
||||
// Frankfurt, Germany, 19.12.2008
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import de.anomic.http.httpRequestHeader;
|
||||
import de.anomic.server.serverObjects;
|
||||
import de.anomic.server.serverProcessor;
|
||||
import de.anomic.server.serverSwitch;
|
||||
|
||||
public class PerformanceConcurrency_p {
|
||||
|
||||
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> sb) {
|
||||
// return variable that accumulates replacements
|
||||
final serverObjects prop = new serverObjects();
|
||||
|
||||
// calculate totals
|
||||
long blocktime_total = 0, exectime_total = 0, passontime_total = 0;
|
||||
Iterator<serverProcessor<?>> threads = serverProcessor.processes();
|
||||
serverProcessor<?> p;
|
||||
while (threads.hasNext()) {
|
||||
p = threads.next();
|
||||
blocktime_total += p.getBlockTime();
|
||||
exectime_total += p.getExecTime();
|
||||
passontime_total += p.getPassOnTime();
|
||||
}
|
||||
if (blocktime_total == 0) blocktime_total = 1;
|
||||
if (exectime_total == 0) exectime_total = 1;
|
||||
if (passontime_total == 0) passontime_total = 1;
|
||||
|
||||
// set templates for latest news from the threads
|
||||
long blocktime, exectime, passontime;
|
||||
threads = serverProcessor.processes();
|
||||
int c = 0;
|
||||
long cycles;
|
||||
while (threads.hasNext()) {
|
||||
p = threads.next();
|
||||
cycles = p.getExecCount();
|
||||
if (cycles == 0) cycles = 1; // avoid division by zero
|
||||
|
||||
// set values to templates
|
||||
prop.put("table_" + c + "_threadname", p.getName());
|
||||
prop.putHTML("table_" + c + "_longdescr", p.getDescription());
|
||||
prop.put("table_" + c + "_queuesize", p.queueSize());
|
||||
prop.put("table_" + c + "_queuesizemax", p.queueSizeMax());
|
||||
prop.put("table_" + c + "_concurrency", p.concurrency());
|
||||
prop.putHTML("table_" + c + "_childs", p.getChilds());
|
||||
|
||||
blocktime = p.getBlockTime();
|
||||
exectime = p.getExecTime();
|
||||
passontime = p.getPassOnTime();
|
||||
prop.putNum("table_" + c + "_blockreadtime", blocktime / cycles);
|
||||
prop.putNum("table_" + c + "_blockreadpercent", 100 * blocktime / blocktime_total);
|
||||
prop.putNum("table_" + c + "_exectime", exectime / cycles);
|
||||
prop.putNum("table_" + c + "_execpercent", 100 * exectime / exectime_total);
|
||||
prop.putNum("table_" + c + "_blockwritetime", passontime / cycles);
|
||||
prop.putNum("table_" + c + "_blockwritepercent", 100 * passontime / passontime_total);
|
||||
prop.putNum("table_" + c + "_totalcycles", p.getExecCount());
|
||||
|
||||
// set a color for the line to show problems
|
||||
boolean problem = false;
|
||||
boolean warning = false;
|
||||
if (p.queueSize() == p.queueSizeMax()) problem = true;
|
||||
if (p.queueSize() > p.queueSizeMax() * 8 / 10) warning = true;
|
||||
if (100 * blocktime / blocktime_total > 80) warning = true;
|
||||
if (100 * exectime / exectime_total > 80) warning = true;
|
||||
if (100 * passontime / passontime_total > 80) warning = true;
|
||||
prop.put("table_" + c + "_class", (!warning && !problem) ? 0 : (!problem) ? 1 : 2);
|
||||
c++;
|
||||
}
|
||||
prop.put("table", c);
|
||||
// return rewrite values for templates
|
||||
return prop;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue