Search in sources :

Example 56 with StopWatch

use of org.apache.camel.util.StopWatch in project camel by apache.

the class CbrEsbPerformanceIntegrationTest method testCbr.

@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);
    log.warn("Ran {} tests in {}ms", count, watch.taken());
}
Also used : StopWatch(org.apache.camel.util.StopWatch) Test(org.junit.Test)

Example 57 with StopWatch

use of org.apache.camel.util.StopWatch in project camel by apache.

the class ContentBasedRoutingPerformanceTest method testFilterSimple.

@Test
public void testFilterSimple() throws InterruptedException {
    template.setDefaultEndpointUri("direct:filter-simple");
    // warm up with 20.000 messages so that the JIT compiler kicks in
    execute(20000);
    resetMock(count);
    StopWatch watch = new StopWatch();
    execute(count);
    assertMockEndpointsSatisfied();
    log.warn("Ran {} tests in {}ms", count, watch.taken());
}
Also used : StopWatch(org.apache.camel.util.StopWatch) Test(org.junit.Test)

Example 58 with StopWatch

use of org.apache.camel.util.StopWatch in project camel by apache.

the class HeaderBasedRoutingPerformanceTest method testFilterSimple.

@Test
public void testFilterSimple() throws InterruptedException {
    template.setDefaultEndpointUri("direct:filter-simple");
    // warm up with 20.000 messages so that the JIT compiler kicks in
    execute(20000);
    resetMock(count);
    StopWatch watch = new StopWatch();
    execute(count);
    assertMockEndpointsSatisfied();
    log.warn("Ran {} tests in {}ms", count, watch.taken());
}
Also used : StopWatch(org.apache.camel.util.StopWatch) Test(org.junit.Test)

Example 59 with StopWatch

use of org.apache.camel.util.StopWatch in project camel by apache.

the class HeaderBasedRoutingPerformanceTest method testChoiceExpression.

@Test
public void testChoiceExpression() throws InterruptedException {
    template.setDefaultEndpointUri("direct:choice-expression");
    // warm up with 20.000 messages so that the JIT compiler kicks in
    execute(20000);
    resetMock(count);
    StopWatch watch = new StopWatch();
    execute(count);
    assertMockEndpointsSatisfied();
    log.warn("Ran {} tests in {}ms", count, watch.taken());
}
Also used : StopWatch(org.apache.camel.util.StopWatch) Test(org.junit.Test)

Example 60 with StopWatch

use of org.apache.camel.util.StopWatch in project camel by apache.

the class HttpProxyRouteTest method testHttpProxy.

@Test
public void testHttpProxy() throws Exception {
    log.info("Sending " + size + " messages to a http endpoint which is proxied/bridged");
    StopWatch watch = new StopWatch();
    for (int i = 0; i < size; i++) {
        String out = template.requestBody("http://localhost:{{port}}?foo=" + i, null, String.class);
        assertEquals("Bye " + i, out);
    }
    log.info("Time taken: " + TimeUtils.printDuration(watch.taken()));
}
Also used : StopWatch(org.apache.camel.util.StopWatch) Test(org.junit.Test)

Aggregations

StopWatch (org.apache.camel.util.StopWatch)101 Test (org.junit.Test)40 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)14 CamelExecutionException (org.apache.camel.CamelExecutionException)10 Exchange (org.apache.camel.Exchange)8 CamelExchangeException (org.apache.camel.CamelExchangeException)6 File (java.io.File)5 ExecutorService (java.util.concurrent.ExecutorService)5 AsyncProcessor (org.apache.camel.AsyncProcessor)5 Producer (org.apache.camel.Producer)5 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 Future (java.util.concurrent.Future)4 AsyncCallback (org.apache.camel.AsyncCallback)4 Endpoint (org.apache.camel.Endpoint)4 ExchangeTimedOutException (org.apache.camel.ExchangeTimedOutException)4 NotifyBuilder (org.apache.camel.builder.NotifyBuilder)4 Date (java.util.Date)3 GenericFile (org.apache.camel.component.file.GenericFile)3