testlets of performance

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@509729 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-02-20 20:08:05 +00:00
parent 32a4c47204
commit 5da043be84
6 changed files with 215 additions and 5 deletions

View File

@ -0,0 +1,36 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.perf;
import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
import org.apache.activemq.store.quick.QuickPersistenceAdapter;
/**
* @version $Revision: 1.3 $
*/
public class AMQStoreDurableTopicTest extends SimpleDurableTopicTest{
protected void configureBroker(BrokerService answer) throws Exception{
File dataFileDir=new File("activemq-data/perfTest/amqdb");
AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
adaptor.setDirectory(dataFileDir);
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
}

View File

@ -0,0 +1,43 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.perf;
import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
/**
* @version $Revision: 1.3 $
*/
public class AMQStoreQueueTest extends SimpleQueueTest{
protected void configureBroker(BrokerService answer) throws Exception{
File dataFileDir = new File("activemq-data/perfTest/amq");
AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
adaptor.setDirectory(dataFileDir);
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
}

View File

@ -0,0 +1,52 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.perf;
import java.io.File;
import org.apache.activeio.journal.active.JournalImpl;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.journal.JournalPersistenceAdapter;
import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
/**
* @version $Revision: 1.3 $
*/
public class JournalKahaDurableTopicTest extends SimpleDurableTopicTest {
protected void configureBroker(BrokerService answer) throws Exception{
File dataFileDir = new File("activemq-data/perfTest");
File journalDir = new File(dataFileDir, "journal").getCanonicalFile();
JournalImpl journal = new JournalImpl(journalDir, 3, 1024*1024*20);
KahaPersistenceAdapter kahaAdaptor = new KahaPersistenceAdapter(new File(dataFileDir, "kaha"));
JournalPersistenceAdapter journalAdaptor = new JournalPersistenceAdapter(journal, kahaAdaptor, answer.getTaskRunnerFactory());
journalAdaptor.setMaxCheckpointWorkers(1);
answer.setPersistenceAdapter(journalAdaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
}

View File

@ -0,0 +1,35 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.perf;
import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.quick.QuickPersistenceAdapter;
/**
* @version $Revision: 1.3 $
*/
public class QuickStoreDurableTopicTest extends SimpleDurableTopicTest{
protected void configureBroker(BrokerService answer) throws Exception{
File dataFileDir=new File("activemq-data/perfTest");
QuickPersistenceAdapter adaptor=new QuickPersistenceAdapter();
adaptor.setDirectory(dataFileDir);
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
}

View File

@ -34,17 +34,17 @@ public class SimpleTopicTest extends TestCase{
protected BrokerService broker;
// protected String
// bindAddress="tcp://localhost:61616?wireFormat.cacheEnabled=true&wireFormat.tightEncodingEnabled=true&jms.useAsyncSend=false";
protected String bindAddress="tcp://localhost:61616?wireFormat.cacheEnabled=true&wireFormat.tightEncodingEnabled=true&jms.useAsyncSend=true";
//protected String bindAddress="tcp://localhost:61616?wireFormat.cacheEnabled=true&wireFormat.tightEncodingEnabled=true&jms.useAsyncSend=true";
// protected String
// bindAddress="tcp://localhost:61616?wireFormat.cacheEnabled=true&wireFormat.tightEncodingEnabled=false";
// protected String bindAddress="vm://localhost?marshal=true";
// protected String bindAddress="vm://localhost";
protected String bindAddress="vm://localhost";
protected PerfProducer[] producers;
protected PerfConsumer[] consumers;
protected String DESTINATION_NAME=getClass().getName();
protected int SAMPLE_COUNT=30;
protected long SAMPLE_INTERVAL=2000;
protected int NUMBER_OF_CONSUMERS=1;
protected int SAMPLE_COUNT=20;
protected long SAMPLE_INTERVAL=1000;
protected int NUMBER_OF_CONSUMERS=0;
protected int NUMBER_OF_PRODUCERS=1;
protected int PAYLOAD_SIZE=1024;
protected byte[] array=null;

View File

@ -0,0 +1,44 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.perf;
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQPrefetchPolicy;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.xbean.BrokerFactoryBean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
/**
* @version $Revision: 1.3 $
*/
public class SlowDurableConsumerTopicTest extends SlowConsumerTopicTest{
protected PerfConsumer[] slowConsumers;
protected int NUMBER_OF_SLOW_CONSUMERS=1;
protected PerfConsumer createSlowConsumer(ConnectionFactory fac,Destination dest,int number) throws JMSException{
return new SlowConsumer(fac,dest,"durableSlowConsumer"+number);
}
}