diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-05-24 22:41:14 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-05-24 22:41:14 +0000 |
| commit | 2fd795207c12b661e79945b17fce0786edc53d5e (patch) | |
| tree | bfb7057875d9132634e3940eade38b7b841d85f8 | |
| parent | 6950d8a33d67423a78f829d63da75dce4d0ebfab (diff) | |
adaptive network peer counter table
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6901 6c8d7289-2bf4-0310-a012-ef5d649a1542
| -rw-r--r-- | htroot/Network.html | 21 | ||||
| -rw-r--r-- | htroot/Network.java | 13 | ||||
| -rw-r--r-- | htroot/Network.xml | 7 |
3 files changed, 32 insertions, 9 deletions
diff --git a/htroot/Network.html b/htroot/Network.html index 24007c0d0..f3e42df84 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -141,19 +141,26 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de <div class="left">
<table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader">
- <td colspan=4>Online Peers</td>
- <td rowspan=2>Number<br/>of Documents</td>
+ <td rowspan=5 class="TableHeader">Network</td>
+ <td colspan=#(active-switch)#2::3::4::5#(/active-switch)#>Online Peers</td>
+ <td rowspan=2>Number of<br/>Documents</td>
<td rowspan=2>Indexing Speed:<br/>Pages Per Minute (PPM)</td>
<td rowspan=2>Query Frequency:<br/>Queries Per Hour (QPH)</td>
</tr>
<tr class="TableHeader">
- <td>Last Week</td>
- <td>Today</td>
+ #(active-switch)#::
+ <td>Today</td>::
+ <td>Last Week</td><td>Today</td>::
+ <td>Last Month</td><td>Last Week</td><td>Today</td>
+ #(/active-switch)#
<td colspan=2>Now</td>
</tr>
<tr class="TableCellDark">
- <td align="right" rowspan=3>#[active-last-week]#</td>
- <td align="right" rowspan=3>#[active-last-day]#</td>
+ #(active-switch)#::
+ <td align="right" rowspan=3>#[last-day]#</td>::
+ <td align="right" rowspan=3>#[last-week]#</td><td align="right" rowspan=3>#[last-day]#</td>::
+ <td align="right" rowspan=3>#[last-month]#</td><td align="right" rowspan=3>#[last-week]#</td><td align="right" rowspan=3>#[last-day]#</td>
+ #(/active-switch)#
<td align="left">Active</td>
<td align="right">#[active-count]#</td>
<td align="right">#[active-links]#</td>
@@ -171,7 +178,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de <td align="right">#[potential-links]#</td>
</tr>
<tr class="TableCellSummary">
- <td align="left" colspan="4">This Peer</td>
+ <td align="left" colspan="#(active-switch)#3::4::5::6#(/active-switch)#">This Peer</td>
<td align="right">#[my-LCount]#</td>
<td align="right">#[my-ppm]#</td>
<td align="right">#[my-qph]#</td>
diff --git a/htroot/Network.java b/htroot/Network.java index 1ac93a285..fff4f8c09 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -153,8 +153,17 @@ public class Network { // overall results: Network statistics
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));
+ int activeLastMonth = sb.peers.sizeActiveSince(30 * 1440);
+ int activeLastWeek = sb.peers.sizeActiveSince(7 * 1440);
+ int activeLastDay = sb.peers.sizeActiveSince(1440);
+ int activeSwitch =
+ (activeLastDay <= conCount) ? 0 :
+ (activeLastWeek <= activeLastDay) ? 1 :
+ (activeLastMonth <= activeLastWeek) ? 2 : 3;
+ prop.putNum("table_active-switch", activeSwitch);
+ prop.putNum("table_active-switch_last-month", activeLastMonth);
+ prop.putNum("table_active-switch_last-week", activeLastWeek);
+ prop.putNum("table_active-switch_last-day", activeLastDay);
prop.putNum("table_active-count", conCount);
prop.putNum("table_active-links", accActLinks);
prop.putNum("table_active-words", accActWords);
diff --git a/htroot/Network.xml b/htroot/Network.xml index 51b66e30d..2426df5ed 100644 --- a/htroot/Network.xml +++ b/htroot/Network.xml @@ -35,6 +35,13 @@ </peer>
#{/list}#
::
+ <history>
+ #(active-switch)#::
+ <month>0</month><week>0</week><day>#[last-day]#</day>::
+ <month>0</month><week>#[last-week]#</week><day>#[last-day]#</day>::
+ <month>#[last-month]#</month><week>#[last-week]#</week><day>#[last-day]#</day>
+ #(/active-switch)#
+ </history>
<active>
<count>#[active-count]#</count>
<links>#[active-links]#</links>
|
