You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2011/07/08 09:56:13 UTC

[smx5] Profiling stragegy

I've been experimenting with a first value added feature for camel routes
deployed in smx5.
The idea is to have a profiling strategy similar to a java profiler.
The output I have in my test is the following:

Processor                                  Count     Time    Total
Route[[From[direct:a]] -> [To[mock:p...]       0        0     3536
 To[mock:polyglot]                          1000      149      149
 Choice[[When[{org.apache.camel.sca...]     1000       63     3386
   When[{org.apache.camel.scala.Sca...]     1000     2208     2277
     To[mock:english]                        328       69       69
   When[{org.apache.camel.scala.Sca...]      672       74      976
     To[mock:dutch]                          339       74       74
     Delay[{2} -> []]                        339      727      727
     To[mock:german]                         339      100      100
   Otherwise[[To[mock:french]]]              333        8       69
     To[mock:french]                         333       60       60


And the route is defined using the scala DSL as:

    context.addRoutes(new RouteBuilder {
      "direct:a" ==> {
        to("mock:polyglot")
        choice {
          when( (e: Exchange) => { sleep(); e.in == "<hello/>" }) {
            to ("mock:english")
          }
          when(_.in == "<hallo/>") {
            to("mock:dutch")
            delay( 2 ms )
            to("mock:german")
          }
          otherwise to ("mock:french")
        }
      }
    });

This currently requires some modifications to camel which I've done locally,
so you won't really be able to experiment with it at this point, but I just
wanted to give a heads up, as I found this feature quite interesting.

-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [smx5] Profiling stragegy

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah !
The other bits I haven't tackled yet is to have such a mechanism work
without changing the camel context definition, i.e. by having some kind of
*global* intercept strategies / processor factories.    Currently, it's only
possible if you configure those strategies explicitely on the CamelContext,
which is not the way I see things.
I'm in vacation next week, so I'll resume that part later ....  FWIW, I've
created a camel branch on github to not disturb the 2.8 release of camel.

On Fri, Jul 8, 2011 at 11:50, Claus Ibsen <cl...@gmail.com> wrote:

> As a Camel guy I think this looks fabulous :)
>
> I am sure with more Camel value add, the interrest for SMX will rise.
>
>
> On Fri, Jul 8, 2011 at 9:56 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> > I've been experimenting with a first value added feature for camel routes
> > deployed in smx5.
> > The idea is to have a profiling strategy similar to a java profiler.
> > The output I have in my test is the following:
> >
> > Processor                                  Count     Time    Total
> > Route[[From[direct:a]] -> [To[mock:p...]       0        0     3536
> >  To[mock:polyglot]                          1000      149      149
> >  Choice[[When[{org.apache.camel.sca...]     1000       63     3386
> >   When[{org.apache.camel.scala.Sca...]     1000     2208     2277
> >     To[mock:english]                        328       69       69
> >   When[{org.apache.camel.scala.Sca...]      672       74      976
> >     To[mock:dutch]                          339       74       74
> >     Delay[{2} -> []]                        339      727      727
> >     To[mock:german]                         339      100      100
> >   Otherwise[[To[mock:french]]]              333        8       69
> >     To[mock:french]                         333       60       60
> >
> >
> > And the route is defined using the scala DSL as:
> >
> >    context.addRoutes(new RouteBuilder {
> >      "direct:a" ==> {
> >        to("mock:polyglot")
> >        choice {
> >          when( (e: Exchange) => { sleep(); e.in == "<hello/>" }) {
> >            to ("mock:english")
> >          }
> >          when(_.in == "<hallo/>") {
> >            to("mock:dutch")
> >            delay( 2 ms )
> >            to("mock:german")
> >          }
> >          otherwise to ("mock:french")
> >        }
> >      }
> >    });
> >
> > This currently requires some modifications to camel which I've done
> locally,
> > so you won't really be able to experiment with it at this point, but I
> just
> > wanted to give a heads up, as I found this feature quite interesting.
> >
> > --
> > ------------------------
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > Open Source SOA
> > http://fusesource.com
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [smx5] Profiling stragegy

Posted by Claus Ibsen <cl...@gmail.com>.
As a Camel guy I think this looks fabulous :)

I am sure with more Camel value add, the interrest for SMX will rise.


On Fri, Jul 8, 2011 at 9:56 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> I've been experimenting with a first value added feature for camel routes
> deployed in smx5.
> The idea is to have a profiling strategy similar to a java profiler.
> The output I have in my test is the following:
>
> Processor                                  Count     Time    Total
> Route[[From[direct:a]] -> [To[mock:p...]       0        0     3536
>  To[mock:polyglot]                          1000      149      149
>  Choice[[When[{org.apache.camel.sca...]     1000       63     3386
>   When[{org.apache.camel.scala.Sca...]     1000     2208     2277
>     To[mock:english]                        328       69       69
>   When[{org.apache.camel.scala.Sca...]      672       74      976
>     To[mock:dutch]                          339       74       74
>     Delay[{2} -> []]                        339      727      727
>     To[mock:german]                         339      100      100
>   Otherwise[[To[mock:french]]]              333        8       69
>     To[mock:french]                         333       60       60
>
>
> And the route is defined using the scala DSL as:
>
>    context.addRoutes(new RouteBuilder {
>      "direct:a" ==> {
>        to("mock:polyglot")
>        choice {
>          when( (e: Exchange) => { sleep(); e.in == "<hello/>" }) {
>            to ("mock:english")
>          }
>          when(_.in == "<hallo/>") {
>            to("mock:dutch")
>            delay( 2 ms )
>            to("mock:german")
>          }
>          otherwise to ("mock:french")
>        }
>      }
>    });
>
> This currently requires some modifications to camel which I've done locally,
> so you won't really be able to experiment with it at this point, but I just
> wanted to give a heads up, as I found this feature quite interesting.
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Fwd: [smx5] Profiling stragegy

Posted by Guillaume Nodet <gn...@gmail.com>.
FWIW, I've uploaded my camel copy to
https://github.com/gnodet/camel/tree/smx5

---------- Forwarded message ----------
From: Guillaume Nodet <gn...@gmail.com>
Date: Fri, Jul 8, 2011 at 09:56
Subject: [smx5] Profiling stragegy
To: dev <de...@servicemix.apache.org>


I've been experimenting with a first value added feature for camel routes
deployed in smx5.
The idea is to have a profiling strategy similar to a java profiler.
The output I have in my test is the following:

Processor                                  Count     Time    Total
Route[[From[direct:a]] -> [To[mock:p...]       0        0     3536
 To[mock:polyglot]                          1000      149      149
 Choice[[When[{org.apache.camel.sca...]     1000       63     3386
   When[{org.apache.camel.scala.Sca...]     1000     2208     2277
     To[mock:english]                        328       69       69
   When[{org.apache.camel.scala.Sca...]      672       74      976
     To[mock:dutch]                          339       74       74
     Delay[{2} -> []]                        339      727      727
     To[mock:german]                         339      100      100
   Otherwise[[To[mock:french]]]              333        8       69
     To[mock:french]                         333       60       60


And the route is defined using the scala DSL as:

    context.addRoutes(new RouteBuilder {
      "direct:a" ==> {
        to("mock:polyglot")
        choice {
          when( (e: Exchange) => { sleep(); e.in == "<hello/>" }) {
            to ("mock:english")
          }
          when(_.in == "<hallo/>") {
            to("mock:dutch")
            delay( 2 ms )
            to("mock:german")
          }
          otherwise to ("mock:french")
        }
      }
    });

This currently requires some modifications to camel which I've done locally,
so you won't really be able to experiment with it at this point, but I just
wanted to give a heads up, as I found this feature quite interesting.

-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com





-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [smx5] Profiling stragegy

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Guillaume,

thanks a bunch, it looks very good.

I see that you implemented in Scala.

Does it mean that SMX5 will by Scala based ?
We had discussion on the mailing list around that but I didn't see an 
agreement about that.

Maybe, we should start a vote to see if the community is ready to go to 
Scala for SMX.

WDYT ?

Regards
JB

On 07/08/2011 09:56 AM, Guillaume Nodet wrote:
> I've been experimenting with a first value added feature for camel routes
> deployed in smx5.
> The idea is to have a profiling strategy similar to a java profiler.
> The output I have in my test is the following:
>
> Processor                                  Count     Time    Total
> Route[[From[direct:a]] ->  [To[mock:p...]       0        0     3536
>   To[mock:polyglot]                          1000      149      149
>   Choice[[When[{org.apache.camel.sca...]     1000       63     3386
>     When[{org.apache.camel.scala.Sca...]     1000     2208     2277
>       To[mock:english]                        328       69       69
>     When[{org.apache.camel.scala.Sca...]      672       74      976
>       To[mock:dutch]                          339       74       74
>       Delay[{2} ->  []]                        339      727      727
>       To[mock:german]                         339      100      100
>     Otherwise[[To[mock:french]]]              333        8       69
>       To[mock:french]                         333       60       60
>
>
> And the route is defined using the scala DSL as:
>
>      context.addRoutes(new RouteBuilder {
>        "direct:a" ==>  {
>          to("mock:polyglot")
>          choice {
>            when( (e: Exchange) =>  { sleep(); e.in == "<hello/>" }) {
>              to ("mock:english")
>            }
>            when(_.in == "<hallo/>") {
>              to("mock:dutch")
>              delay( 2 ms )
>              to("mock:german")
>            }
>            otherwise to ("mock:french")
>          }
>        }
>      });
>
> This currently requires some modifications to camel which I've done locally,
> so you won't really be able to experiment with it at this point, but I just
> wanted to give a heads up, as I found this feature quite interesting.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com