diff --git a/htroot/PerformanceConcurrency_p.html b/htroot/PerformanceConcurrency_p.html index f405b732d..40a53bf17 100644 --- a/htroot/PerformanceConcurrency_p.html +++ b/htroot/PerformanceConcurrency_p.html @@ -17,7 +17,8 @@ Thread Queue Size
Current Queue Size
Maximum - Concurrency:
Number of Threads + Executors:
Current Number of Threads + Concurrency:
Maximum Number of Threads Childs Average
Block Time
Reading Average
Exec Time @@ -30,6 +31,7 @@ #[threadname]# #[queuesize]# #[queuesizemax]# + #[executors]# #[concurrency]# #[childs]# #[blockreadtime]# ms diff --git a/htroot/PerformanceConcurrency_p.java b/htroot/PerformanceConcurrency_p.java index 1fea5e839..051a207e5 100644 --- a/htroot/PerformanceConcurrency_p.java +++ b/htroot/PerformanceConcurrency_p.java @@ -59,9 +59,10 @@ public class PerformanceConcurrency_p { // set values to templates prop.put("table_" + c + "_threadname", p.getName()); prop.putHTML("table_" + c + "_longdescr", p.getDescription()); - prop.put("table_" + c + "_queuesize", p.queueSize()); - prop.put("table_" + c + "_queuesizemax", p.queueSizeMax()); - prop.put("table_" + c + "_concurrency", p.concurrency()); + prop.put("table_" + c + "_queuesize", p.getQueueSize()); + prop.put("table_" + c + "_queuesizemax", p.getMaxQueueSize()); + prop.put("table_" + c + "_concurrency", p.getMaxConcurrency()); + prop.put("table_" + c + "_executors", p.getExecutors()); prop.putHTML("table_" + c + "_childs", p.getChilds()); blocktime = p.getBlockTime(); @@ -78,8 +79,8 @@ public class PerformanceConcurrency_p { // set a color for the line to show problems boolean problem = false; boolean warning = false; - if (p.queueSize() == p.queueSizeMax()) problem = true; - if (p.queueSize() > p.queueSizeMax() * 8 / 10) warning = true; + if (p.getQueueSize() == p.getMaxQueueSize()) problem = true; + if (p.getQueueSize() > p.getMaxQueueSize() * 8 / 10) warning = true; if (100 * blocktime / blocktime_total > 80) warning = true; if (100 * exectime / exectime_total > 80) warning = true; if (100 * passontime / passontime_total > 80) warning = true; diff --git a/source/net/yacy/crawler/CrawlStacker.java b/source/net/yacy/crawler/CrawlStacker.java index 1f413e9b3..324fc0d87 100644 --- a/source/net/yacy/crawler/CrawlStacker.java +++ b/source/net/yacy/crawler/CrawlStacker.java @@ -104,7 +104,7 @@ public final class CrawlStacker { public int size() { - return this.requestQueue.queueSize(); + return this.requestQueue.getQueueSize(); } public boolean isEmpty() { if (!this.requestQueue.queueIsEmpty()) return false; diff --git a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java index a3db23401..a5beb7784 100644 --- a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java +++ b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java @@ -104,6 +104,7 @@ public abstract class AbstractBlockingThread extends Abst busyCycles++; } } + this.manager.decExecutors(); this.close(); logSystem("thread '" + this.getName() + "' terminated."); } diff --git a/source/net/yacy/kelondro/workflow/InstantBlockingThread.java b/source/net/yacy/kelondro/workflow/InstantBlockingThread.java index 5ddc81615..a220a1cf9 100644 --- a/source/net/yacy/kelondro/workflow/InstantBlockingThread.java +++ b/source/net/yacy/kelondro/workflow/InstantBlockingThread.java @@ -75,7 +75,7 @@ public class InstantBlockingThread extends AbstractBlocki @Override public int getJobCount() { - return getManager().queueSize(); + return getManager().getQueueSize(); } @Override diff --git a/source/net/yacy/kelondro/workflow/WorkflowProcessor.java b/source/net/yacy/kelondro/workflow/WorkflowProcessor.java index 296892f58..1efff648a 100644 --- a/source/net/yacy/kelondro/workflow/WorkflowProcessor.java +++ b/source/net/yacy/kelondro/workflow/WorkflowProcessor.java @@ -93,7 +93,7 @@ public class WorkflowProcessor { return this.methodName; } - public int queueSize() { + public int getQueueSize() { if (this.input == null) return 0; return this.input.size(); } @@ -102,14 +102,25 @@ public class WorkflowProcessor { return this.input == null || this.input.isEmpty(); } - public int queueSizeMax() { + public int getMaxQueueSize() { if (this.input == null) return 0; return this.input.size() + this.input.remainingCapacity(); } - public int concurrency() { + public int getMaxConcurrency() { return this.maxpoolsize; } + + public int getExecutors() { + return this.executorRunning.get(); + } + + /** + * the decExecutors method may only be called within the AbstractBlockingThread while loop!! + */ + public void decExecutors() { + this.executorRunning.decrementAndGet(); + } public J take() throws InterruptedException { // read from the input queue diff --git a/source/net/yacy/peers/Dispatcher.java b/source/net/yacy/peers/Dispatcher.java index f14f83071..0897efbab 100644 --- a/source/net/yacy/peers/Dispatcher.java +++ b/source/net/yacy/peers/Dispatcher.java @@ -130,7 +130,7 @@ public class Dispatcher { } public int transmissionSize() { - return (this.indexingTransmissionProcessor == null) ? 0 : this.indexingTransmissionProcessor.queueSize(); + return (this.indexingTransmissionProcessor == null) ? 0 : this.indexingTransmissionProcessor.getQueueSize(); } /** @@ -374,7 +374,7 @@ public class Dispatcher { */ public boolean dequeueContainer() { if (this.transmissionCloud == null) return false; - if (this.indexingTransmissionProcessor.queueSize() > this.indexingTransmissionProcessor.concurrency()) return false; + if (this.indexingTransmissionProcessor.getQueueSize() > this.indexingTransmissionProcessor.getMaxConcurrency()) return false; ByteArray maxtarget = null; int maxsize = -1; for (final Map.Entry chunk: this.transmissionCloud.entrySet()) { diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index f3563e896..7da4c3d4e 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -1132,10 +1132,10 @@ public final class Switchboard extends serverSwitch { } public int getIndexingProcessorsQueueSize() { - return this.indexingDocumentProcessor.queueSize() - + this.indexingCondensementProcessor.queueSize() - + this.indexingAnalysisProcessor.queueSize() - + this.indexingStorageProcessor.queueSize(); + return this.indexingDocumentProcessor.getQueueSize() + + this.indexingCondensementProcessor.getQueueSize() + + this.indexingAnalysisProcessor.getQueueSize() + + this.indexingStorageProcessor.getQueueSize(); } public void overwriteNetworkDefinition() throws FileNotFoundException, IOException {