[smx5] Profiling stragegy

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[smx5] Profiling stragegy

Guillaume Nodet
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: [smx5] Profiling stragegy

Jean-Baptiste Onofré
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é
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Fwd: [smx5] Profiling stragegy

Guillaume Nodet
Administrator
In reply to this post by Guillaume Nodet
FWIW, I've uploaded my camel copy to
https://github.com/gnodet/camel/tree/smx5

---------- Forwarded message ----------
From: Guillaume Nodet <[hidden email]>
Date: Fri, Jul 8, 2011 at 09:56
Subject: [smx5] Profiling stragegy
To: dev <[hidden email]>


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
Reply | Threaded
Open this post in threaded view
|

Re: [smx5] Profiling stragegy

Claus Ibsen-2
In reply to this post by Guillaume Nodet
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 <[hidden email]> 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: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Reply | Threaded
Open this post in threaded view
|

Re: [smx5] Profiling stragegy

Guillaume Nodet
Administrator
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 <[hidden email]> 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 <[hidden email]> 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: [hidden email]
> 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