You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by salemi <sa...@avaya.com> on 2013/07/30 00:20:22 UTC

Re: best practice for logging execution time

I like to identify the average execution time spent in Camel. I have a
aggregator that aggregate 10 messages before it send them out to the
endpoint.
Would EventNotifier still work?



-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736458.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: best practice for logging execution time

Posted by Bilgin Ibryam <bi...@gmail.com>.
You can get these kind of statistics using JMX too
Did you see http://camel.apache.org/camel-jmx.html

Bilgin

On 29 July 2013 23:20, salemi <sa...@avaya.com> wrote:
> I like to identify the average execution time spent in Camel. I have a
> aggregator that aggregate 10 messages before it send them out to the
> endpoint.
> Would EventNotifier still work?
>
>
>
> -----
> Alireza Salemi
> --
> View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736458.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: best practice for logging execution time

Posted by salemi <sa...@avaya.com>.
Claus,


I have to figure out how many messages we can put trough one Camel instance.
We need to at least manage to route 1000 messages a second.

Looking at the JMX stats I see each message takes about 10ms. I was
wondering how can Identify where the times are spent and how I can improve
my route!

What the route does is receive a messages from JMS topic convert it from
JSON String to a JSON Object and for send tto javaspaces. The javaspaces
right is a clusted write do the performance is bad. So I added a aggregator
in front of the javaspaces and now I am writing 10 messages at the time to
javaspaces. So the question how to measure the times from receiving the 10
messages received until they get written in javaspaces.  

<route>
<from uri="jms:topic:topic1">
<unmarshal ref="csJSON"/>
<to uri="direct:javaspaces"/>
<route>
  
<route id="javaspaces" shutdownRunningTask="CompleteCurrentTaskOnly"
autoStartup="true">
<from uri="direct:javaspaces"/>
<transacted/>
<aggregate strategyRef="aggregatorStrategy" completionSize="10"
completionTimeout="1000">
<correlationExpression>
<simple>${body.entity}</simple>
</correlationExpression>
<bean ref="jsInterface"/>
</aggregate>
</route>



-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736506.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: best practice for logging execution time

Posted by Christian Posta <ch...@gmail.com>.
You can also take a look at the Log component which allows you to log
groups of exchanges based on number or based on time:

from("activemq:orders").to(
"log:com.mycompany.order?level=DEBUG&groupInterval=10000&groupDelay=60000&groupActiveOnly=false"
).to("bean:processOrder");


http://camel.apache.org/log.html


On Tue, Jul 30, 2013 at 8:23 AM, Claus Ibsen <cl...@gmail.com> wrote:

> On Tue, Jul 30, 2013 at 12:20 AM, salemi <sa...@avaya.com> wrote:
> > I like to identify the average execution time spent in Camel. I have a
> > aggregator that aggregate 10 messages before it send them out to the
> > endpoint.
> > Would EventNotifier still work?
> >
>
> It depends what and how fine grained you want to measure?
> So what do you mean by "execution time spent in Camel" ?
>
> And as Bilgin wrote you can also get a lot of stats from JMX.
>
>
>
>
> >
> >
> > -----
> > Alireza Salemi
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736458.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: best practice for logging execution time

Posted by Claus Ibsen <cl...@gmail.com>.
The JMX stats is per Exchange in the processor nodes.
There is JMX stats per route as well which would then be "per route"
And likewise a JMX stats for the entire CamelContext.

So you have 3 different levels of stats.


So in your aggregate route, you will have stats for all incoming
exchanges into the aggregator.
And stats for the outgoing. So you can have 10 incoming, and 1 outgoing exchange




On Fri, Aug 2, 2013 at 2:31 AM, salemi <sa...@avaya.com> wrote:
>
>
> I have the following route and aggregating the 10 Exchanges into one. Now
> when I run Camel JMX and it provides mewith the meanProcessingTime. What
> does that mean for the route below. Is  the mean time for a exchange that
> contains 10 exchanges or for each exchange that arrives trough JMS?
>
> <route>
> <from uri="jms:topic:topic1">
> <unmarshal ref="csJSON"/>
> <to uri="direct:javaspaces"/>
> <route>
>
> <route id="javaspaces" shutdownRunningTask="CompleteCurrentTaskOnly"
> autoStartup="true">
> <from uri="direct:javaspaces"/>
> <transacted/>
> <aggregate strategyRef="aggregatorStrategy" completionSize="10"
> completionTimeout="1000">
> <correlationExpression>
> <simple>${body.entity}</simple>
> </correlationExpression>
> <bean ref="jsInterface"/>
> </aggregate>
> </route>
>
>
>
>
>
> -----
> Alireza Salemi
> --
> View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: best practice for logging execution time

Posted by salemi <sa...@avaya.com>.

I have the following route and aggregating the 10 Exchanges into one. Now
when I run Camel JMX and it provides mewith the meanProcessingTime. What
does that mean for the route below. Is  the mean time for a exchange that
contains 10 exchanges or for each exchange that arrives trough JMS?

<route>
<from uri="jms:topic:topic1">
<unmarshal ref="csJSON"/>
<to uri="direct:javaspaces"/>
<route>
 
<route id="javaspaces" shutdownRunningTask="CompleteCurrentTaskOnly"
autoStartup="true">
<from uri="direct:javaspaces"/>
<transacted/>
<aggregate strategyRef="aggregatorStrategy" completionSize="10"
completionTimeout="1000">
<correlationExpression>
<simple>${body.entity}</simple>
</correlationExpression>
<bean ref="jsInterface"/>
</aggregate>
</route> 





-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736667.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: best practice for logging execution time

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jul 30, 2013 at 12:20 AM, salemi <sa...@avaya.com> wrote:
> I like to identify the average execution time spent in Camel. I have a
> aggregator that aggregate 10 messages before it send them out to the
> endpoint.
> Would EventNotifier still work?
>

It depends what and how fine grained you want to measure?
So what do you mean by "execution time spent in Camel" ?

And as Bilgin wrote you can also get a lot of stats from JMX.




>
>
> -----
> Alireza Salemi
> --
> View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging-execution-time-tp2844045p5736458.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen