You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by humayun0156 <hu...@gmail.com> on 2013/07/20 08:05:01 UTC

Measure elapsed time of specific process

Hi, i want to compare time of a specific process. so after google search i
found the link 
http://cmoulliard.blogspot.com/2011/02/measure-elapsed-time-with-camel.html
<http://cmoulliard.blogspot.com/2011/02/measure-elapsed-time-with-camel.html>  

but i need more specific which @Gregor mention in comment : 
(MyRouteBuilder.java)
DateTime time;
from("direct:foo")
.routeIde("foo")
.stopWatch("fooTimer").start(time)
.process(...)
.stopWatch("fooTimer").stop()
.log("took " + time.getTime() + "s")
.end();

is it possible?



--
View this message in context: http://camel.465427.n5.nabble.com/Measure-elapsed-time-of-specific-process-tp5735915.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Measure elapsed time of specific process

Posted by Claus Ibsen <cl...@gmail.com>.
No we are not adding start|stop stopwatch to the DSL. We want the DSL
to be confused on EIPs
http://camel.apache.org/eip

If you want to time something use a processor / bean and call a start
and stop methods

MyStopWatch stopWatch = new MyStopWatch();

.bean(stopWatch, "start")
.process
.bean(stopWatch, "stop")



On Sat, Jul 20, 2013 at 8:05 AM, humayun0156 <hu...@gmail.com> wrote:
> Hi, i want to compare time of a specific process. so after google search i
> found the link
> http://cmoulliard.blogspot.com/2011/02/measure-elapsed-time-with-camel.html
> <http://cmoulliard.blogspot.com/2011/02/measure-elapsed-time-with-camel.html>
>
> but i need more specific which @Gregor mention in comment :
> (MyRouteBuilder.java)
> DateTime time;
> from("direct:foo")
> .routeIde("foo")
> .stopWatch("fooTimer").start(time)
> .process(...)
> .stopWatch("fooTimer").stop()
> .log("took " + time.getTime() + "s")
> .end();
>
> is it possible?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Measure-elapsed-time-of-specific-process-tp5735915.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