Author: cmueller
Date: Sat Jan 5 16:40:53 2013
New Revision: 1429327
URL: http://svn.apache.org/viewvc?rev=1429327&view=rev
Log:
CAMEL-5918: Add performance tests - work in progress
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/SplitterPerformanceTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/AbstractBaseEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/CbrEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/EchoService.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/HttpHbrEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/ProxyEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SecureProxyEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SoapHbrEsbPerformanceIntegrationTest.java
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/XsltEsbPerformanceIntegrationTest.java
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/SplitterPerformanceTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/SplitterPerformanceTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/SplitterPerformanceTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/SplitterPerformanceTest.java
Sat Jan 5 16:40:53 2013
@@ -42,7 +42,7 @@ public class SplitterPerformanceTest ext
+ "</soapenv:Body>"
+ "</soapenv:Envelope>";
- protected static String PAYLOAD = null;
+ protected static final String PAYLOAD;
static {
StringBuilder builder = new StringBuilder(HEADER);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/AbstractBaseEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/AbstractBaseEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/AbstractBaseEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/AbstractBaseEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -54,7 +54,7 @@ public abstract class AbstractBaseEsbPer
ServletContextHandler context = new
ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/service");
server.setHandler(context);
- context.addServlet(new ServletHolder(new
EchoService()),"/EchoService");
+ context.addServlet(new ServletHolder(new EchoService()),
"/EchoService");
server.start();
payload = readPayload();
@@ -80,7 +80,8 @@ public abstract class AbstractBaseEsbPer
Map<String, Object> headers = new HashMap<String, Object>();
headers.put("Content-Type", "text/xml;charset=UTF-8");
headers.put("SOAPAction", "urn:buyStocks.2");
-
+ headers.put("routing", "xadmin;server1;community#1.0##");
+
for (int i = 0; i < messagesToSend; i++) {
template.requestBodyAndHeaders(payload, headers);
}
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/CbrEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/CbrEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/CbrEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/CbrEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -23,6 +23,9 @@ public class CbrEsbPerformanceIntegratio
@Test
public void testCbr() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/CBRProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/CBRProxy", count);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/EchoService.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/EchoService.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/EchoService.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/EchoService.java
Sat Jan 5 16:40:53 2013
@@ -16,9 +16,6 @@
*/
package org.apache.camel.test.perf.esb;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
@@ -26,10 +23,13 @@ import java.nio.channels.ReadableByteCha
import java.nio.channels.WritableByteChannel;
import java.util.ArrayList;
import java.util.List;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
public class EchoService extends HttpServlet {
- public static volatile long delayMillis = 0;
+ public static volatile long delayMillis;
private static final long serialVersionUID = 1L;
private static final int DEFAULT_BUFFER_SIZE = 4;
@@ -48,20 +48,21 @@ public class EchoService extends HttpSer
soapAction = soapAction.replaceAll("\"", "");
}
int dotPos = soapAction.indexOf(".");
- int secondDotPos = (dotPos == -1 ? -1 :
soapAction.indexOf(".", dotPos+1));
+ int secondDotPos = dotPos == -1 ? -1 : soapAction.indexOf(".",
dotPos + 1);
if (secondDotPos > 0) {
- bufKBytes =
Integer.parseInt(soapAction.substring(dotPos+1, secondDotPos));
- delaySecs =
Integer.parseInt(soapAction.substring(secondDotPos+1));
+ bufKBytes = Integer.parseInt(soapAction.substring(dotPos +
1, secondDotPos));
+ delaySecs =
Integer.parseInt(soapAction.substring(secondDotPos + 1));
} else if (dotPos > 0) {
- bufKBytes =
Integer.parseInt(soapAction.substring(dotPos+1));
+ bufKBytes = Integer.parseInt(soapAction.substring(dotPos +
1));
}
}
bb = ByteBuffer.allocate(bufKBytes * 1024);
ReadableByteChannel rbc =
Channels.newChannel(request.getInputStream());
- int len, tot = 0;
+ int len = 0;
+ int tot = 0;
while ((len = rbc.read(bb)) > 0) {
tot += len;
if (tot >= bb.capacity()) {
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/HttpHbrEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/HttpHbrEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/HttpHbrEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/HttpHbrEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -23,6 +23,9 @@ public class HttpHbrEsbPerformanceIntegr
@Test
public void testHttpHbr() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/CBRTransportHeaderProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/CBRTransportHeaderProxy", count);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/ProxyEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/ProxyEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/ProxyEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/ProxyEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -23,6 +23,9 @@ public class ProxyEsbPerformanceIntegrat
@Test
public void testProxy() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/DirectProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/DirectProxy", count);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SecureProxyEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SecureProxyEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SecureProxyEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SecureProxyEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -26,6 +26,9 @@ public class SecureProxyEsbPerformanceIn
@Test
public void testSecureProxy() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/SecureProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/SecureProxy", count);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SoapHbrEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SoapHbrEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SoapHbrEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/SoapHbrEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -23,6 +23,9 @@ public class SoapHbrEsbPerformanceIntegr
@Test
public void testSoapHbr() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/CBRSOAPHeaderProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/CBRSOAPHeaderProxy", count);
Modified:
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/XsltEsbPerformanceIntegrationTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/XsltEsbPerformanceIntegrationTest.java?rev=1429327&r1=1429326&r2=1429327&view=diff
==============================================================================
---
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/XsltEsbPerformanceIntegrationTest.java
(original)
+++
camel/trunk/tests/camel-performance/src/test/java/org/apache/camel/test/perf/esb/XsltEsbPerformanceIntegrationTest.java
Sat Jan 5 16:40:53 2013
@@ -23,6 +23,9 @@ public class XsltEsbPerformanceIntegrati
@Test
public void testXSLTProxy() throws Exception {
+ // warm up with 1.000 messages so that the JIT compiler kicks in
+ send("http://127.0.0.1:8192/service/XSLTProxy", 1000);
+
StopWatch watch = new StopWatch();
send("http://127.0.0.1:8192/service/XSLTProxy", count);