From fc471096087c4db962417357ff40987b37fd5d65 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sat, 5 Jan 2013 00:37:52 +0100 Subject: [PATCH] added 'Last Hour' to network statistics --- htroot/Network.html | 16 +++++++++------- htroot/Network.java | 9 ++++++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htroot/Network.html b/htroot/Network.html index 770db5c08..ac70ce1c4 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -184,24 +184,26 @@ To see a list of all APIs, please visit the Network - Online Peers + Online Peers Number of
Documents Indexing Speed:
Pages Per Minute (PPM) Query Frequency:
Queries Per Hour (QPH) #(active-switch)#:: - Today:: - Last WeekToday:: - Last MonthLast WeekToday + Last Hour:: + TodayLast Hour:: + Last WeekTodayLast Hour:: + Last MonthLast WeekTodayLast Hour #(/active-switch)# Now #(active-switch)#:: - #[last-day]#:: - #[last-week]##[last-day]#:: - #[last-month]##[last-week]##[last-day]# + #[last-hour]#:: + #[last-day]##[last-hour]#:: + #[last-week]##[last-day]##[last-hour]#:: + #[last-month]##[last-week]##[last-day]##[last-hour]# #(/active-switch)# Active #[active-count]# diff --git a/htroot/Network.java b/htroot/Network.java index 7c9aa1544..4971b68ca 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -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);