added 'Last Hour' to network statistics

pull/1/head
Michael Peter Christen 12 years ago
parent 38d3feae65
commit fc47109608

@ -184,24 +184,26 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<table border="0" cellpadding="2" cellspacing="1" width="1024">
<tr class="TableHeader">
<td rowspan="5" class="TableHeader" width="10%">Network</td>
<td colspan="#(active-switch)#2::3::4::5#(/active-switch)#" width="22%">Online Peers</td>
<td colspan="#(active-switch)#2::3::4::5::6#(/active-switch)#" width="22%">Online Peers</td>
<td rowspan="2" width="22%">Number of<br/>Documents</td>
<td rowspan="2" width="22%">Indexing Speed:<br/>Pages Per Minute (PPM)</td>
<td rowspan="2" width="22%">Query Frequency:<br/>Queries Per Hour (QPH)</td>
</tr>
<tr class="TableHeader">
#(active-switch)#::
<td>Today</td>::
<td>Last&nbsp;Week</td><td>Today</td>::
<td>Last&nbsp;Month</td><td>Last&nbsp;Week</td><td>Today</td>
<td>Last Hour</td>::
<td>Today</td><td>Last Hour</td>::
<td>Last&nbsp;Week</td><td>Today</td><td>Last Hour</td>::
<td>Last&nbsp;Month</td><td>Last&nbsp;Week</td><td>Today</td><td>Last Hour</td>
#(/active-switch)#
<td colspan="2">Now</td>
</tr>
<tr class="TableCellDark">
#(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>
<td align="right" rowspan="3">#[last-hour]#</td>::
<td align="right" rowspan="3">#[last-day]#</td><td align="right" rowspan="3">#[last-hour]#</td>::
<td align="right" rowspan="3">#[last-week]#</td><td align="right" rowspan="3">#[last-day]#</td><td align="right" rowspan="3">#[last-hour]#</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><td align="right" rowspan="3">#[last-hour]#</td>
#(/active-switch)#
<td align="left">Active</td>
<td align="right">#[active-count]#</td>

@ -156,14 +156,17 @@ public class Network {
final int activeLastMonth = sb.peers.sizeActiveSince(30 * 1440);
final int activeLastWeek = sb.peers.sizeActiveSince(7 * 1440);
final int activeLastDay = sb.peers.sizeActiveSince(1440);
final int activeLastHour = sb.peers.sizeActiveSince(60);
final int activeSwitch =
(activeLastDay <= conCount) ? 0 :
(activeLastWeek <= activeLastDay) ? 1 :
(activeLastMonth <= activeLastWeek) ? 2 : 3;
(activeLastHour <= conCount) ? 0 :
(activeLastDay <= activeLastHour) ? 1 :
(activeLastWeek <= activeLastDay) ? 2 :
(activeLastMonth <= activeLastWeek) ? 3 : 4;
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-switch_last-hour", activeLastHour);
prop.putNum("table_active-count", conCount);
prop.putNum("table_active-links", accActLinks);
prop.putNum("table_active-words", accActWords);

Loading…
Cancel
Save