diff --git a/htroot/Network.html b/htroot/Network.html index 77dbc54ad..3826e0f65 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -141,86 +141,47 @@ To see a list of all APIs, please visit the - - - - + + + + + + + + + + - + + + + + - + - + - - - - - -
Branch#Peers#All Links#All WordsOnline Peers#Links#WordsIndexing SpeedQuery Frequency
Last WeekTodayNow
Active (connected Senior and Principal)#[active-last-week]##[active-last-day]#Active #[active-count]# #[active-links]# #[active-words]##[gppm]# Pages Per Minute (PPM)#[gqph]# Queries Per Hour (QPH)
Passive (disconnected Senior and Principal)Passive #[passive-count]# #[passive-links]# #[passive-words]#
Potential (Junior)Potential #[potential-count]# #[potential-links]# #[potential-words]#
Network Total#[all-count]##[all-links]##[all-words]#
-
- -
-
-
- -
+

The yacy Network -

+

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Network legend:
 dark font:senior/principal peers
 lightred font:passiv peers ( < 5 hour passive time)
 turquoise font:junior peers
 red point:this peer
-
-
-

Your Peer:

+ Your Peer: @@ -264,6 +225,40 @@ To see a list of all APIs, please visit the

+

Name
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Network legend:
 dark font:senior/principal peers
 lightred font:passiv peers ( < 5 hour passive time)
 turquoise font:junior peers
 red point:this peer

+
:: #(comment)# diff --git a/htroot/Network.java b/htroot/Network.java index c5826dd45..1ac93a285 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -153,6 +153,8 @@ 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)); prop.putNum("table_active-count", conCount); prop.putNum("table_active-links", accActLinks); prop.putNum("table_active-words", accActWords); diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.java index 1ec251e96..61c496274 100644 --- a/htroot/NetworkPicture.java +++ b/htroot/NetworkPicture.java @@ -49,8 +49,8 @@ public class NetworkPicture { if (post != null) { width = post.getInt("width", 768); height = post.getInt("height", 576); - passiveLimit = post.getInt("pal", 720); - potentialLimit = post.getInt("pol", 720); + passiveLimit = post.getInt("pal", 1440); + potentialLimit = post.getInt("pol", 1440); maxCount = post.getInt("max", 1000); corona = post.get("corona", "true").equals("true"); bgcolor = post.get("bgcolor", bgcolor); @@ -63,7 +63,7 @@ public class NetworkPicture { if (height > 1920) height = 1920; if (passiveLimit > 1000000) passiveLimit = 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); } diff --git a/source/de/anomic/yacy/graphics/NetworkGraph.java b/source/de/anomic/yacy/graphics/NetworkGraph.java index 28724d6c6..f26efc5f9 100644 --- a/source/de/anomic/yacy/graphics/NetworkGraph.java +++ b/source/de/anomic/yacy/graphics/NetworkGraph.java @@ -121,7 +121,7 @@ public class NetworkGraph { if (primarySearches == null) return null; // this was a local search and there are no threads // 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); // TODO: fix cloning of ymageMatrix pictures @@ -164,10 +164,6 @@ public class NetworkGraph { 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) { if ((networkPicture == null) || ((System.currentTimeMillis() - networkPictureDate) > maxAge)) { drawNetworkPicture(seedDB, width, height, passiveLimit, potentialLimit, maxCount, corona, networkName, networkTitle, bgcolor); diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java index 93b4ecb7d..ec5823fc6 100644 --- a/source/de/anomic/yacy/yacySeedDB.java +++ b/source/de/anomic/yacy/yacySeedDB.java @@ -414,7 +414,34 @@ public final class yacySeedDB implements AlternativeDomainNames { 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 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(); }