Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 28459 invoked from network); 2 Jun 2006 02:27:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Jun 2006 02:27:36 -0000 Received: (qmail 99234 invoked by uid 500); 2 Jun 2006 02:27:35 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 99191 invoked by uid 500); 2 Jun 2006 02:27:35 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 99182 invoked by uid 99); 2 Jun 2006 02:27:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2006 19:27:35 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2006 19:27:34 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4C8531A983A; Thu, 1 Jun 2006 19:27:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411019 - /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/ Date: Fri, 02 Jun 2006 02:27:13 -0000 To: activemq-commits@geronimo.apache.org From: aco@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060602022714.4C8531A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: aco Date: Thu Jun 1 19:27:12 2006 New Revision: 411019 URL: http://svn.apache.org/viewvc?rev=411019&view=rev Log: - Added a getClientID to retrieve the connectionID of a client - Added a getSettings to PerfMeasurable client and remove unnecessary getters. - Added a PerfMeasurable parameter to the listeners. Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConfigurableClientSupport.java incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerfClientSupport.java incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfEventAdapter.java incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfEventListener.java incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConfigurableClientSupport.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConfigurableClientSupport.java?rev=411019&r1=411018&r2=411019&view=diff ============================================================================== --- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConfigurableClientSupport.java (original) +++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConfigurableClientSupport.java Thu Jun 1 19:27:12 2006 @@ -32,6 +32,7 @@ private String serverType = ""; private String factoryClass = ""; + private String clientID = ""; private Map factorySettings = new HashMap(); private Map connectionSettings = new HashMap(); @@ -154,6 +155,14 @@ return jmsMessageConsumer; } + public String getClientID() { + try { + return getConnection().getClientID(); + } catch (Exception e) { + return ""; + } + } + public TopicSubscriber createDurableSubscriber(Topic dest, String name, String selector, boolean noLocal) throws JMSException { jmsMessageConsumer = getSession().createDurableSubscriber(dest, name, selector, noLocal); configureJmsObject(jmsMessageConsumer, consumerSettings); @@ -192,14 +201,14 @@ public void addConfigParam(String key, Object value) { // Simple mapping of JMS Server to connection factory class - if (key.equalsIgnoreCase("server")) { + if (key.equalsIgnoreCase("client.server")) { serverType = value.toString(); if (serverType.equalsIgnoreCase(AMQ_SERVER)) { factoryClass = AMQ_CONNECTION_FACTORY_CLASS; } // Manually specify the connection factory class to use - } else if (key.equalsIgnoreCase("factoryClass")) { + } else if (key.equalsIgnoreCase("client.factoryClass")) { factoryClass = value.toString(); // Connection factory specific settings Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerfClientSupport.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerfClientSupport.java?rev=411019&r1=411018&r2=411019&view=diff ============================================================================== --- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerfClientSupport.java (original) +++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerfClientSupport.java Thu Jun 1 19:27:12 2006 @@ -16,13 +16,12 @@ */ package org.apache.activemq.tool; +import java.util.Map; +import java.util.HashMap; + public class JmsPerfClientSupport extends JmsConfigurableClientSupport implements PerfMeasurable { protected long throughput = 0; - protected long interval = 1000; // 1 sec - protected long duration = 1000 * 60 * 10; // 10 min - protected long rampUpTime = 1000 * 60 * 1; // 1 min - protected long rampDownTime = 1000 * 60 * 1; // 1 min protected PerfEventListener listener = null; @@ -46,43 +45,28 @@ throughput += val; } - public long getInterval() { - return interval; - } - - public void setInterval(long val) { - this.interval = val; - } - - public long getDuration() { - return duration; - } - - public void setDuration(long val) { - this.duration = val; - } - - public long getRampUpTime() { - return rampUpTime; - } - - public void setRampUpTime(long val) { - this.rampUpTime = val; - } - - public long getRampDownTime() { - return rampDownTime; - } - - public void setRampDownTime(long val) { - this.rampDownTime = val; - } - public void setPerfEventListener(PerfEventListener listener) { this.listener = listener; } public PerfEventListener getPerfEventListener() { return listener; + } + + public Map getClientSettings() { + Map settings = new HashMap(); + settings.put("client.server", getServerType()); + settings.put("client.factoryClass", getFactoryClass()); + settings.put("client.clientID", getClientID()); + settings.putAll(getFactorySettings()); + settings.putAll(getConnectionSettings()); + settings.putAll(getSessionSettings()); + settings.putAll(getQueueSettings()); + settings.putAll(getTopicSettings()); + settings.putAll(getProducerSettings()); + settings.putAll(getConsumerSettings()); + settings.putAll(getMessageSettings()); + + return settings; } } Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java?rev=411019&r1=411018&r2=411019&view=diff ============================================================================== --- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java (original) +++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java Thu Jun 1 19:27:12 2006 @@ -80,7 +80,7 @@ public void createProducer(int messageSize) throws JMSException { - listener.onConfigStart(); + listener.onConfigStart(this); // Create connection factory if (factory != null) { @@ -120,7 +120,7 @@ message = createTextMessage(buff); } - listener.onConfigEnd(); + listener.onConfigEnd(this); } public void sendCountBasedMessages(long messageCount) throws JMSException { @@ -132,20 +132,22 @@ if (message != null) { // Send to more than one actual destination if (dest.length > 1) { - listener.onPublishStart(); + listener.onPublishStart(this); for (int i=0; i 1) { - listener.onPublishStart(); + listener.onPublishStart(this); for (int i=0; i 1) { - listener.onPublishStart(); + listener.onPublishStart(this); while (System.currentTimeMillis() < endTime) { for (int j=0; j 1) { - listener.onPublishStart(); + listener.onPublishStart(this); while (System.currentTimeMillis() < endTime) { for (int j=0; j