Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added list of crawls to status_p.xml
orbiterc4efb612e262
diff --git a/htroot/api/status_p.java b/htroot/api/status_p.javaindex 07eb120f4..625fa7066 100644--- a/htroot/api/status_p.java+++ b/htroot/api/status_p.java@@ -26,6 +26,9 @@// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAimport net.yacy.cora.protocol.RequestHeader;+import net.yacy.crawler.CrawlSwitchboard;+import net.yacy.crawler.data.CrawlProfile;+import net.yacy.kelondro.index.RowHandleSet;import net.yacy.kelondro.io.ByteCount;import net.yacy.kelondro.util.MemoryControl;import net.yacy.kelondro.workflow.WorkflowProcessor;@@ -100,6 +103,27 @@ public class status_p {prop.putNum("noloadCrawlSize", sb.crawlQueues.noloadCrawlJobSize());prop.put("noloadCrawlState", STATE_RUNNING);+ // generate crawl profile table+ int count = 0;+ final int domlistlength = (post == null) ? 160 : post.getInt("domlistlength", 160);+ CrawlProfile profile;+ // put active crawls into list+ String hosts = "";+ for (final byte[] h: sb.crawler.getActive()) {+ profile = sb.crawler.getActive(h);+ if (CrawlSwitchboard.DEFAULT_PROFILES.contains(profile.name())) continue;+ profile.putProfileEntry("crawlProfiles_list_", prop, true, false, count, domlistlength);+ RowHandleSet urlhashes = sb.crawler.getURLHashes(h);+ prop.put("crawlProfiles_list_" + count + "_count", urlhashes == null ? "unknown" : Integer.toString(urlhashes.size()));+ if (profile.urlMustMatchPattern() == CrawlProfile.MATCH_ALL_PATTERN) {+ hosts = hosts + "," + profile.name();+ }+ count++;+ }+ prop.put("crawlProfiles_list", count);+ prop.put("crawlProfiles_count", count);+ prop.put("crawlProfiles", count == 0 ? 0 : 1);+// return rewrite propertiesreturn prop;}diff --git a/htroot/api/status_p.xml b/htroot/api/status_p.xmlindex 7eec1d761..acc550ccb 100644--- a/htroot/api/status_p.xml+++ b/htroot/api/status_p.xml@@ -49,5 +49,20 @@<size>#[noloadCrawlSize]#</size><state>#[noloadCrawlState]#</state></noloadcrawlerqueue>++<!-- crawl profile list -->+#(crawlProfiles)#::+ <crawls count="#[count]#">+ #{list}#+ <crawl>+ <name>#[name]#</name>+ <count>#[count]#</count>+ <handle>#[handle]#</handle>+ <depth>#[depth]#</depth>+ <status>#(terminateButton)#terminated::alive#(/terminateButton)#</status>+ </crawl>+ #{/list}#+ </crawls>+#(/crawlProfiles)#</status>