From 4eca0f88302b6ba98985dc9e1bd2b46972471d7e Mon Sep 17 00:00:00 2001 From: auron_x Date: Thu, 17 Aug 2006 19:15:30 +0000 Subject: [PATCH] *) fixed PPM calculation for multiple indexer-threads *) fixed totalPPM calculation and added total PPM to Network.html git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2418 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Network.html | 2 ++ htroot/Network.java | 1 + source/de/anomic/yacy/yacyPeerActions.java | 13 ++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htroot/Network.html b/htroot/Network.html index ba44e75d0..090d37a5b 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -167,6 +167,7 @@ YaCy Cluster Indexing Speed: #[gppm]# Pages Per Minute (Accumulated PPM over Act Received
Words Received
URLs PPM +total PPM #Seeds #Connects
per hour @@ -183,6 +184,7 @@ YaCy Cluster Indexing Speed: #[gppm]# Pages Per Minute (Accumulated PPM over Act #[my-rI]# #[my-rU]# #[my-ppm]# +#[my-totalppm]# #[my-seeds]# #[my-connects]# diff --git a/htroot/Network.java b/htroot/Network.java index df4cb8396..7b96efcff 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -139,6 +139,7 @@ public class Network { prop.put("table_my-rI", groupDigits(seed.get(yacySeed.INDEX_IN, "0"))); prop.put("table_my-rU", groupDigits(seed.get(yacySeed.URL_IN, "0"))); prop.put("table_my-ppm", myppm); + prop.put("table_my-totalppm", sb.getConfig("totalPPM","0")); prop.put("table_my-seeds", seed.get(yacySeed.SCOUNT, "-")); prop.put("table_my-connects", groupDigits(seed.get(yacySeed.CCOUNT, "0"))); } diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java index 616f3c929..010e2e677 100644 --- a/source/de/anomic/yacy/yacyPeerActions.java +++ b/source/de/anomic/yacy/yacyPeerActions.java @@ -108,7 +108,11 @@ public class yacyPeerActions { } long uptime = ((System.currentTimeMillis() - Long.parseLong(sb.getConfig("startupTime", "0"))) / 1000) / 60; long uptimediff = uptime - Long.parseLong(sb.getConfig("lastseedcheckUptime", "0")); //TODO: Do not use the switchboard? - long indexedc = sb.getThread("80_indexing").getBusyCycles(); + int indexing_cluster = Integer.parseInt(sb.getConfig("80_indexing_cluster", "1")); + if (indexing_cluster < 1) indexing_cluster = 1; + long indexedc = 0; + for(int i=0;i 5 || ((String)sb.getConfig("lastseedcheckUptime", "-1")).equals("-1") ){ sb.setConfig("lastseedcheckUptime", uptime); @@ -123,9 +127,12 @@ public class yacyPeerActions { seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(0)); }else{ //set the PPM - seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(indexedcdiff / uptimediff)); + seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(indexedcdiff / uptimediff)); } - sb.setConfig("totalPPM", Long.toString(indexedc / (uptime + 1))); + if(uptime > 0) + sb.setConfig("totalPPM", Long.toString(indexedc / uptime)); + else + sb.setConfig("totalPPM", Long.toString(indexedc / 1)); //no division by zero seedDB.mySeed.put(yacySeed.UPTIME, Long.toString(uptime)); // the number of minutes that the peer is up in minutes/day (moving average MA30) seedDB.mySeed.put(yacySeed.LCOUNT, Integer.toString(sb.urlPool.loadedURL.size())); // the number of links that the peer has stored (LURL's)