extended statistics on Network servlet page

- added number of online peers at the last day and the last week
- changed design of statistic table
- network picture now shows exactly those peers that are counted in the statistic overview for one day

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6897 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 431852f0a7
commit bfdb9f4e06

@ -141,86 +141,47 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<div class="left"> <div class="left">
<table border="0" cellpadding="2" cellspacing="1"> <table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader"> <tr class="TableHeader">
<td>Branch</td> <td colspan=4>Online Peers</td>
<td>#Peers</td> <td rowspan=2>#Links</td>
<td>#All Links</td> <td rowspan=2>#Words</td>
<td>#All Words</td> <td rowspan=2>Indexing Speed</td>
<td rowspan=2>Query Frequency</td>
</tr>
<tr class="TableHeader">
<td>Last Week</td>
<td>Today</td>
<td colspan=2>Now</td>
</tr> </tr>
<tr class="TableCellDark"> <tr class="TableCellDark">
<td align="left">Active (connected Senior and Principal)</td> <td align="right" rowspan=3>#[active-last-week]#</td>
<td align="right" rowspan=3>#[active-last-day]#</td>
<td align="left">Active</td>
<td align="right">#[active-count]#</td> <td align="right">#[active-count]#</td>
<td align="right">#[active-links]#</td> <td align="right">#[active-links]#</td>
<td align="right">#[active-words]#</td> <td align="right">#[active-words]#</td>
<td align="right" rowspan=3>#[gppm]# Pages Per Minute (PPM)</td>
<td align="right" rowspan=3>#[gqph]# Queries Per Hour (QPH)</td>
</tr> </tr>
<tr class="TableCellDark"> <tr class="TableCellDark">
<td align="left">Passive (disconnected Senior and Principal)</td> <td align="left">Passive</td>
<td align="right">#[passive-count]#</td> <td align="right">#[passive-count]#</td>
<td align="right">#[passive-links]#</td> <td align="right">#[passive-links]#</td>
<td align="right">#[passive-words]#</td> <td align="right">#[passive-words]#</td>
</tr> </tr>
<tr class="TableCellDark"> <tr class="TableCellDark">
<td align="left">Potential (Junior)</td> <td align="left">Potential</td>
<td align="right">#[potential-count]#</td> <td align="right">#[potential-count]#</td>
<td align="right">#[potential-links]#</td> <td align="right">#[potential-links]#</td>
<td align="right">#[potential-words]#</td> <td align="right">#[potential-words]#</td>
</tr> </tr>
<tr class="TableCellSummary">
<td align="left">Network Total</td>
<td align="right">#[all-count]#</td>
<td align="right">#[all-links]#</td>
<td align="right">#[all-words]#</td>
</tr>
</table> </table>
</div> </div>
<div class="left">
<ul>
<li>Indexing Speed: #[gppm]# Pages Per Minute (PPM)</li>
<li>Query Frequency: #[gqph]# Queries Per Hour (QPH)</li>
</ul>
</div>
<div class="left"> <div class="left"><p>
</div>
<div class="left">
<a href="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF"><img src="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF" alt="The yacy Network" /></a> <a href="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF"><img src="NetworkPicture.png?width=768&amp;height=576&amp;bgcolor=FFFFFF" alt="The yacy Network" /></a>
</div> </p></div>
<div class="left"> <div class="left">
<table border="0"> Your Peer:
<tr>
<td>&nbsp;</td>
<td><strong>Network legend:</strong></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="background-color:#000000">&nbsp;</td>
<td>dark font</td>
<td>:</td>
<td>senior/principal peers</td>
</tr>
<tr>
<td style="background-color:#E7B7AF">&nbsp;</td>
<td>lightred font</td>
<td>:</td>
<td>passiv peers ( &lt; 5 hour passive time)</td>
</tr>
<tr>
<td style="background-color:#A7A75F">&nbsp;</td>
<td>turquoise font</td>
<td>:</td>
<td>junior peers</td>
</tr>
<tr>
<td style="background-color:#C1A77F">&nbsp;</td>
<td>red point</td>
<td>:</td>
<td>this peer</td>
</tr>
</table>
</div>
<div class="left">
<p>Your Peer:</p>
<table border="0" cellpadding="2" cellspacing="1"> <table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader"> <tr class="TableHeader">
<td>Name</td> <td>Name</td>
@ -264,6 +225,40 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</tr> </tr>
</table> </table>
</div> </div>
<div class="left"><p>
<table border="0">
<tr>
<td>&nbsp;</td>
<td><strong>Network legend:</strong></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="background-color:#000000">&nbsp;</td>
<td>dark font</td>
<td>:</td>
<td>senior/principal peers</td>
</tr>
<tr>
<td style="background-color:#E7B7AF">&nbsp;</td>
<td>lightred font</td>
<td>:</td>
<td>passiv peers ( &lt; 5 hour passive time)</td>
</tr>
<tr>
<td style="background-color:#A7A75F">&nbsp;</td>
<td>turquoise font</td>
<td>:</td>
<td>junior peers</td>
</tr>
<tr>
<td style="background-color:#C1A77F">&nbsp;</td>
<td>red point</td>
<td>:</td>
<td>this peer</td>
</tr>
</table></p>
</div>
:: ::
#(comment)# #(comment)#

@ -153,6 +153,8 @@ public class Network {
// overall results: Network statistics // overall results: Network statistics
if (iAmActive) conCount++; else if (mySeedType.equals(yacySeed.PEERTYPE_JUNIOR)) potCount++; if (iAmActive) conCount++; else if (mySeedType.equals(yacySeed.PEERTYPE_JUNIOR)) potCount++;
prop.putNum("table_active-last-week", sb.peers.sizeActiveSince(7 * 1440));
prop.putNum("table_active-last-day", sb.peers.sizeActiveSince(1440));
prop.putNum("table_active-count", conCount); prop.putNum("table_active-count", conCount);
prop.putNum("table_active-links", accActLinks); prop.putNum("table_active-links", accActLinks);
prop.putNum("table_active-words", accActWords); prop.putNum("table_active-words", accActWords);

@ -49,8 +49,8 @@ public class NetworkPicture {
if (post != null) { if (post != null) {
width = post.getInt("width", 768); width = post.getInt("width", 768);
height = post.getInt("height", 576); height = post.getInt("height", 576);
passiveLimit = post.getInt("pal", 720); passiveLimit = post.getInt("pal", 1440);
potentialLimit = post.getInt("pol", 720); potentialLimit = post.getInt("pol", 1440);
maxCount = post.getInt("max", 1000); maxCount = post.getInt("max", 1000);
corona = post.get("corona", "true").equals("true"); corona = post.get("corona", "true").equals("true");
bgcolor = post.get("bgcolor", bgcolor); bgcolor = post.get("bgcolor", bgcolor);
@ -63,7 +63,7 @@ public class NetworkPicture {
if (height > 1920) height = 1920; if (height > 1920) height = 1920;
if (passiveLimit > 1000000) passiveLimit = 1000000; if (passiveLimit > 1000000) passiveLimit = 1000000;
if (potentialLimit > 1000000) potentialLimit = 1000000; if (potentialLimit > 1000000) potentialLimit = 1000000;
if (maxCount > 1000) maxCount = 1000; if (maxCount > 10000) maxCount = 10000;
return NetworkGraph.getNetworkPicture(sb.peers, 10000, width, height, passiveLimit, potentialLimit, maxCount, corona, env.getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified"), env.getConfig("network.unit.description", "unspecified"), bgcolor); return NetworkGraph.getNetworkPicture(sb.peers, 10000, width, height, passiveLimit, potentialLimit, maxCount, corona, env.getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified"), env.getConfig("network.unit.description", "unspecified"), bgcolor);
} }

@ -121,7 +121,7 @@ public class NetworkGraph {
if (primarySearches == null) return null; // this was a local search and there are no threads if (primarySearches == null) return null; // this was a local search and there are no threads
// get a copy of a recent network picture // get a copy of a recent network picture
final RasterPlotter eventPicture = getNetworkPicture(seedDB, 120000, Switchboard.getSwitchboard().getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified"), Switchboard.getSwitchboard().getConfig("network.unit.description", "unspecified"), COL_BACKGROUND); final RasterPlotter eventPicture = getNetworkPicture(seedDB, 120000, 640, 480, 300, 300, 1000, true, Switchboard.getSwitchboard().getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified"), Switchboard.getSwitchboard().getConfig("network.unit.description", "unspecified"), COL_BACKGROUND);
//if (eventPicture instanceof ymageMatrix) eventPicture = (ymageMatrix) eventPicture; //new ymageMatrix((ymageMatrix) eventPicture); //if (eventPicture instanceof ymageMatrix) eventPicture = (ymageMatrix) eventPicture; //new ymageMatrix((ymageMatrix) eventPicture);
// TODO: fix cloning of ymageMatrix pictures // TODO: fix cloning of ymageMatrix pictures
@ -164,10 +164,6 @@ public class NetworkGraph {
return eventPicture; return eventPicture;
} }
public static RasterPlotter getNetworkPicture(final yacySeedDB seedDB, final long maxAge, final String networkName, final String networkTitle, final String bgcolor) {
return getNetworkPicture(seedDB, maxAge, 640, 480, 300, 300, 1000, true, networkName, networkTitle, bgcolor);
}
public static RasterPlotter getNetworkPicture(final yacySeedDB seedDB, final long maxAge, final int width, final int height, final int passiveLimit, final int potentialLimit, final int maxCount, final boolean corona, final String networkName, final String networkTitle, final String bgcolor) { public static RasterPlotter getNetworkPicture(final yacySeedDB seedDB, final long maxAge, final int width, final int height, final int passiveLimit, final int potentialLimit, final int maxCount, final boolean corona, final String networkName, final String networkTitle, final String bgcolor) {
if ((networkPicture == null) || ((System.currentTimeMillis() - networkPictureDate) > maxAge)) { if ((networkPicture == null) || ((System.currentTimeMillis() - networkPictureDate) > maxAge)) {
drawNetworkPicture(seedDB, width, height, passiveLimit, potentialLimit, maxCount, corona, networkName, networkTitle, bgcolor); drawNetworkPicture(seedDB, width, height, passiveLimit, potentialLimit, maxCount, corona, networkName, networkTitle, bgcolor);

@ -414,7 +414,34 @@ public final class yacySeedDB implements AlternativeDomainNames {
return e.next(); return e.next();
} }
public int sizeConnected() { /**
* count the number of peers that had been seed within the time limit
* @param limit the time limit in minutes. 1440 minutes is a day
* @return the number of peers seen in the given time
*/
public int sizeActiveSince(long limit) {
int c = seedActiveDB.size();
yacySeed seed;
Iterator<yacySeed> i = seedsSortedDisconnected(false, yacySeed.LASTSEEN);
while (i.hasNext()) {
seed = i.next();
if (seed != null) {
if (Math.abs((System.currentTimeMillis() - seed.getLastSeenUTC()) / 1000 / 60) > limit) break;
c++;
}
}
i = seedsSortedPotential(false, yacySeed.LASTSEEN);
while (i.hasNext()) {
seed = i.next();
if (seed != null) {
if (Math.abs((System.currentTimeMillis() - seed.getLastSeenUTC()) / 1000 / 60) > limit) break;
c++;
}
}
return c;
}
public int sizeConnected() {
return seedActiveDB.size(); return seedActiveDB.size();
} }

Loading…
Cancel
Save