Mercurial > stress-tester
changeset 888:b9d643afb2fc
in progress
author | Devel 1 |
---|---|
date | Mon, 26 Mar 2018 13:03:43 +0200 |
parents | 8975b49f535f |
children | 05a158902216 |
files | stress-tester/src/main/java/com/passus/st/client/Client.java stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java stress-tester/src/main/java/com/passus/st/job/TestJob.java |
diffstat | 4 files changed, 12 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/Client.java Mon Mar 26 09:46:08 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/Client.java Mon Mar 26 13:03:43 2018 +0200 @@ -14,5 +14,6 @@ public void setEmitter(Emitter emitter); + public void join() throws InterruptedException; }
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Mon Mar 26 09:46:08 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Mon Mar 26 13:03:43 2018 +0200 @@ -243,6 +243,7 @@ return false; } + @Override public void join() throws InterruptedException { for (HttpClientWorker worker : workers) { worker.join();
--- a/stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java Mon Mar 26 09:46:08 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java Mon Mar 26 13:03:43 2018 +0200 @@ -25,42 +25,22 @@ private PluginFactory<DomainConfigurator> configuratorFactory = DomainConfiguratorFactory.getInstance(); - private TestJob job; - - public TestJobConfigurator() { - this.job = new TestJob(); - } - - public TestJobConfigurator(TestJob job) { - Assert.notNull(job, "job"); - this.job = job; - } - public PluginFactory<DomainConfigurator> getConfiguratorFactory() { return configuratorFactory; } - public TestJob getJob() { - return job; - } - - public void setJob(TestJob job) { - Assert.notNull(job, "job"); - this.job = job; - } - public void setConfiguratorFactory(PluginFactory<DomainConfigurator> configuratorFactory) { Assert.notNull(configuratorFactory, "configuratorFactory"); this.configuratorFactory = configuratorFactory; } protected Map<String, DomainConfigurator> getDomainsConfigurator(Configuration config, Errors errors, - BiPredicate<String, DomainConfigurator> filter) { + BiPredicate<String, DomainConfigurator> filter) { return getDomainsConfigurator(config.getRootNode(), errors, filter); } protected Map<String, DomainConfigurator> getDomainsConfigurator(CNode rootNode, Errors errors, - BiPredicate<String, DomainConfigurator> filter) { + BiPredicate<String, DomainConfigurator> filter) { if (!validateType(rootNode, NodeType.MAP, errors)) { return null; } @@ -93,7 +73,7 @@ } protected void doValidate(Configuration config, Errors errors, ConfigurationContext context, - BiPredicate<String, DomainConfigurator> filter) { + BiPredicate<String, DomainConfigurator> filter) { Map<String, DomainConfigurator> configurators = getDomainsConfigurator(config, errors, filter); if (!errors.hasError()) { for (Entry<String, DomainConfigurator> entry : configurators.entrySet()) { @@ -118,7 +98,7 @@ } protected void doConfigure(Configuration config, Errors errors, ConfigurationContext context, - BiPredicate<String, DomainConfigurator> filter) { + BiPredicate<String, DomainConfigurator> filter) { Map<String, DomainConfigurator> configurators = getDomainsConfigurator(config, errors, filter); if (!errors.hasError()) { for (Entry<String, DomainConfigurator> entry : configurators.entrySet()) {
--- a/stress-tester/src/main/java/com/passus/st/job/TestJob.java Mon Mar 26 09:46:08 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/job/TestJob.java Mon Mar 26 13:03:43 2018 +0200 @@ -146,6 +146,12 @@ } } + public void join() throws InterruptedException { + for (Client client : clients) { + client.join(); + } + } + private static <T> void populateIfNotNull(Collection<T> srcCollection, Collection<T> dstCollection) { if (srcCollection != null) { dstCollection.addAll(srcCollection);