fixed QPM output

QPM is temporarily called QPH (until more search requests are present?)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3313 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent a480bb7afa
commit 819ff21c92

@ -37,6 +37,7 @@
<td><strong>Info</strong><br />&nbsp;</td>
<td><strong>Release/<br />SVN</strong><br />&nbsp;</td>
<td><strong>PPM</strong><br />&nbsp;</td>
<td><strong>QPH</strong><br />&nbsp;</td>
<td><strong>Last<br />Seen</strong><br />&nbsp;&nbsp;<a href="/Network.html?page=#[page]#&amp;sort=LastSeen&amp;order=up">&lt;</a>&nbsp;<a href="/Network.html?page=#[page]#&amp;sort=LastSeen&amp;order=down">&gt;</a></td>
<td><strong>UTC</strong><br />Offset<br />&nbsp;</td>
<td><strong>Location</strong><br /><br />&nbsp;</td>
@ -73,6 +74,7 @@
<td>#(type)##(direct)#<img src="/env/grafics/JuniorPassive.gif" title="Type: Junior | Contact: passive" alt="Junior passive" />::<img src="/env/grafics/JuniorDirect.gif" title="Type: Junior | Contact: direct" alt="Junior direct" /></img>::<img src="/env/grafics/JuniorOffline.gif" title="Type: Junior | Contact: offline" alt="Junior offline" />#(/direct)#::#(direct)#<img src="/env/grafics/SeniorPassive.gif" title="Type: Senior | Contact: passive" alt="senior passive" />::<img src="/env/grafics/SeniorDirect.gif" title="Type: Senior | Contact: direct" alt="Senior direct" />::<img src="/env/grafics/SeniorOffline.gif" title="Type: Senior | Contact: offline" alt="Senior offline" />#(/direct)#::<a href="#[url]#">#(direct)#<img src="/env/grafics/PrincipalPassive.gif" title="Type: Principal | Contact: passive | Seed download: possible" alt="Principal passive" />::<img src="/env/grafics/PrincipalDirect.gif" title="Type: Principal | Contact: direct | Seed download: possible" alt="Principal active" />::<img src="/env/grafics/PrincipalOffline.gif" title="Type: Principal | Contact: offline | Seed download: ?" alt="Principal offline" />#(/direct)#</a>#(/type)##(acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" title="Accept Crawl: yes" alt="crawl possible" />::<img src="/env/grafics/CrawlYesOffline.gif" title="Accept Crawl: yes" alt="crawl possible" />#(/acceptcrawl)##(dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" title="DHT Receive: no; #[peertags]#" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" title="DHT Receive: yes" alt="DHT receive enabled" />::<img src="/env/grafics/DHTReceiveYesOffline.gif" title="DHT Receive: yes" alt="DHT receive enabled" />#(/dhtreceive)##(rankingreceive)#<img src="/env/grafics/RankingReceiveNo.gif" title="Ranking Receive: no" alt="no ranking receive" />::<img src="/env/grafics/RankingReceiveYes.gif" title="Ranking Receive: yes" alt="Ranking receive enabled" />::<img src="/env/grafics/RankingCollects.gif" title="Ranking Receive: collection" alt="ranking collects" />#(/rankingreceive)#</td>
<td align="right">#[version]#</td>
<td align="right">#[ppm]#</td>
<td align="right">#[qph]#</td>
<td align="right">#[lastSeen]#</td>
<td align="right">#[utc]#</td>
<td align="right">#[location]#</td>
@ -143,7 +145,11 @@
</tr>
</table>
<p>
YaCy Cluster Indexing Speed: #[gppm]# Pages Per Minute (Accumulated PPM over Active Peers).
YaCy Cluster
<ul>
<li>Indexing Speed: #[gppm]# Pages Per Minute (PPM)</li>
<li>Query Frequency: #[gqph]# Queries Per Hour (QPH)</li>
</ul>
</p>
<p>Your Peer:</p>
<table border="0" cellpadding="2" cellspacing="1">
@ -160,7 +166,9 @@
<td>Received<br />Words</td>
<td>Received<br />URLs</td>
<td>PPM</td>
<td>QPH</td>
<td>total PPM</td>
<td>total QPH</td>
<td>#Seeds</td>
<td>#Connects<br />per hour</td>
</tr>
@ -177,7 +185,9 @@
<td align="right">#[my-rI]#</td>
<td align="right">#[my-rU]#</td>
<td align="right">#[my-ppm]#</td>
<td align="right">#[my-qph]#</td>
<td align="right">#[my-totalppm]#</td>
<td align="right">#[my-totalqph]#</td>
<td align="right">#[my-seeds]#</td>
<td align="right">#[my-connects]#</td>
</tr>

@ -54,6 +54,7 @@ import java.util.Map;
import de.anomic.http.httpHeader;
import de.anomic.http.httpc;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverCodings;
import de.anomic.server.serverDate;
import de.anomic.server.serverObjects;
@ -69,7 +70,8 @@ public class Network {
private static final String STR_TABLE_LIST = "table_list_";
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch switchboard) {
plasmaSwitchboard sb = (plasmaSwitchboard) switchboard;
final long start = System.currentTimeMillis();
// return variable that accumulates replacements
@ -93,7 +95,9 @@ public class Network {
// final boolean complete = ((post == null) ? false : post.get("links", "false").equals("true"));
final long otherppm = yacyCore.seedDB.countActivePPM();
long myppm = 0, myqpm = 0;
final long otherqpm = yacyCore.seedDB.countActiveQPM();
long myppm = 0;
double myqph = 0d;
// create own peer info
yacySeed seed = yacyCore.seedDB.mySeed;
@ -131,7 +135,7 @@ public class Network {
myppm = seed.getPPM();
myqpm = seed.getQPM();
myqph = 60d * seed.getQPM();
prop.put("table_my-version", seed.get(yacySeed.VERSION, "-"));
prop.put("table_my-utc", seed.get(yacySeed.UTC, "-"));
prop.put("table_my-uptime", serverDate.intervalToString(60000 * Long.parseLong(seed.get(yacySeed.UPTIME, ""))));
@ -142,9 +146,9 @@ public class Network {
prop.put("table_my-rI", groupDigits(seed.get(yacySeed.INDEX_IN, "0")));
prop.put("table_my-rU", groupDigits(seed.get(yacySeed.URL_IN, "0")));
prop.put("table_my-ppm", myppm);
prop.put("table_my-qpm", myqpm);
prop.put("table_my-totalppm", sb.getConfig("totalPPM","0"));
prop.put("table_my-totalqpm", sb.getConfig("totalQPM","0"));
prop.put("table_my-qph", Double.toString(Math.round(10d * myqph) / 10d));
prop.put("table_my-totalppm", sb.totalPPM);
prop.put("table_my-totalqph", Double.toString(Math.round(600d * sb.totalQPM) / 10d));
prop.put("table_my-seeds", seed.get(yacySeed.SCOUNT, "-"));
prop.put("table_my-connects", groupDigits(seed.get(yacySeed.CCOUNT, "0")));
}
@ -165,6 +169,7 @@ public class Network {
prop.put("table_all-words", groupDigits(accActWords + accPassWords + accPotWords));
prop.put("table_gppm", otherppm + ((iAmActive) ? myppm : 0));
prop.put("table_gqph", Double.toString(Math.round(600d * otherqpm + 10d * ((iAmActive) ? myqph : 0d)) / 10d));
// String comment = "";
prop.put("table_comment", 0);
@ -286,7 +291,8 @@ public class Network {
Map wikiMap;
Map blogMap;
String userAgent, location;
int PPM, QPM;
int PPM;
double QPM;
long myValue=0, nextValue=0, prevValue=0, nextPPM=0, myPPM=0;
while (e.hasMoreElements() && conCount < maxCount) {
seed = (yacySeed) e.nextElement();
@ -338,16 +344,8 @@ public class Network {
prop.put(STR_TABLE_LIST + conCount + "_updatedBlog_subject", (String) blogMap.get("subject"));
prop.put(STR_TABLE_LIST + conCount + "_updatedBlog_address", seed.getAddress());
}
try {
PPM = Integer.parseInt(seed.get(yacySeed.ISPEED, "-"));
} catch (NumberFormatException ee) {
PPM = 0;
}
try {
QPM = Integer.parseInt(seed.get(yacySeed.RSPEED, "-"));
} catch (NumberFormatException ee) {
QPM = 0;
}
PPM = seed.getPPM();
QPM = seed.getQPM();
if (((startURL = (String) isCrawling.get(seed.hash)) != null) && (PPM >= 10)) {
prop.put(STR_TABLE_LIST + conCount + "_isCrawling", 1);
prop.put(STR_TABLE_LIST + conCount + "_isCrawling_page", startURL);
@ -443,7 +441,7 @@ public class Network {
prop.put(STR_TABLE_LIST + conCount + "_rI", groupDigits(seed.get(yacySeed.INDEX_IN, "0")));
prop.put(STR_TABLE_LIST + conCount + "_rU", groupDigits(seed.get(yacySeed.URL_IN, "0")));
prop.put(STR_TABLE_LIST + conCount + "_ppm", PPM);
prop.put(STR_TABLE_LIST + conCount + "_qpm", QPM);
prop.put(STR_TABLE_LIST + conCount + "_qph", Math.round(60d * QPM));
conCount++;
} // seed != null
} // while

@ -43,7 +43,7 @@
::
<div>Uptime: #[uptime]#</div>
<div>Links/RWI: #[links]# / #[words]#</div>
<div>PPM/QPM: #[pagesperminute]# / #[queriesperminute]#</div>
<div>PPM/QPH: #[pagesperminute]# / #[queriesperhour]#</div>
<div>Connects: <span title="connected Juniors">#[juniorConnects]#</span> | <span title="connected Seniors">#[seniorConnects]#</span> | <span title="connected Principals">#[principalConnects]#</span> | <span title="disconnected peers">#[disconnects]#</span> (#[connects]# peers/hour)
#(/peerStatistics)#
</td></tr>

@ -206,7 +206,7 @@ public class Status {
prop.put("peerStatistics", 1);
prop.put("peerStatistics_uptime", serverDate.intervalToString(uptime));
prop.put("peerStatistics_pagesperminute", yacyCore.seedDB.mySeed.get(yacySeed.ISPEED, "unknown"));
prop.put("peerStatistics_queriesperminute", yacyCore.seedDB.mySeed.get(yacySeed.RSPEED, "unknown"));
prop.put("peerStatistics_queriesperhour", Double.toString(Math.round(600d * yacyCore.seedDB.mySeed.getQPM()) / 10d));
prop.put("peerStatistics_links", yacyCore.seedDB.mySeed.get(yacySeed.LCOUNT, "unknown"));
prop.put("peerStatistics_words", yacyCore.seedDB.mySeed.get(yacySeed.ICOUNT, "unknown"));
prop.put("peerStatistics_juniorConnects", yacyCore.peerActions.juniorConnects);

@ -247,6 +247,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public long lastindexedPages = 0;
public double requestedQueries = 0d;
public double lastrequestedQueries = 0d;
public int totalPPM = 0;
public double totalQPM = 0d;
/*
* Remote Proxy configuration

@ -112,7 +112,7 @@ public class yacyPeerActions {
long uptime = (System.currentTimeMillis() - sb.startupTime) / 1000;
long uptimediff = uptime - sb.lastseedcheckuptime;
long indexedcdiff = sb.indexedPages - sb.lastindexedPages;
double requestcdiff = sb.requestedQueries - sb.lastrequestedQueries;
//double requestcdiff = sb.requestedQueries - sb.lastrequestedQueries;
if (uptimediff > 300 || sb.lastseedcheckuptime == -1 ) {
sb.lastseedcheckuptime = uptime;
sb.lastindexedPages = sb.indexedPages;
@ -120,10 +120,10 @@ public class yacyPeerActions {
}
//the speed of indexing (pages/minute) of the peer
sb.totalPPM = (int) (sb.indexedPages * 60 / Math.max(uptime, 1));
seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(Math.round(Math.max((float) indexedcdiff, 0f) * 60f / Math.max((float) uptimediff, 1f))));
sb.setConfig("totalPPM", sb.indexedPages * 60 / Math.max(uptime, 1));
seedDB.mySeed.put(yacySeed.RSPEED, Long.toString(Math.round(Math.max((float) requestcdiff, 0f) * 60f / Math.max((float) uptimediff, 1f))));
sb.setConfig("totalQPM", sb.requestedQueries * 60d / Math.max((double) uptime, 1d));
sb.totalQPM = sb.requestedQueries * 60d / Math.max((double) uptime, 1d);
seedDB.mySeed.put(yacySeed.RSPEED, Double.toString(sb.totalQPM /*Math.max((float) requestcdiff, 0f) * 60f / Math.max((float) uptimediff, 1f)*/ ));
seedDB.mySeed.put(yacySeed.UPTIME, Long.toString(uptime/60)); // the number of minutes that the peer is up in minutes/day (moving average MA30)
seedDB.mySeed.put(yacySeed.LCOUNT, Integer.toString(sb.wordIndex.loadedURL.size())); // the number of links that the peer has stored (LURL's)

@ -433,11 +433,11 @@ public class yacySeed {
}
}
public int getQPM() {
public double getQPM() {
try {
return Integer.parseInt(get(yacySeed.RSPEED, yacySeed.ZERO));
return Double.parseDouble(get(yacySeed.RSPEED, yacySeed.ZERO));
} catch (NumberFormatException e) {
return 0;
return 0d;
}
}

Loading…
Cancel
Save