如何在驼峰中实现路由性能测量

Big*_*Ben 3 java performance apache-camel

我想在我的路线中计算步骤的时间.我正在寻找使用驼峰AOP启动计时器,运行步骤,停止并记录计时器.但是AOP现在已被弃用了,我看过使用拦截机制,但它之前只添加了"建议",我之后也需要它.有干净的方法吗?

Cla*_*sen 8

是的,有很多选择.

只是对上面关于Fuse IDE的评论的更正.该编辑器是开源的,可供任何人免费使用.您不需要订阅.自Red Hat收购我们以来,我们免费提供此服务.

1)关于监控.然后你可以查看一些博客 http://camel.apache.org/articles,其中有人写过关于监控Camel应用程序的文章.

2)在http://camel.apache.org/user-stories.html上有一些第三方应用程序,例如CamelWatch等.

3)James Strachan(Camel的创始人)和Fuse团队的其他人正在为Camel和其他集成框架开发Web控制台,名为Hawt IO - http://hawt.io/

4)正如艾伦已经指出的那样,你可以使用事件通知器,它会发出你可以利用的事件.

5)有第三方工具可以集成的JMX API,如Fuse HQ/JON/Hyperic /等

6)有一个用于nagios集成的camel-nagios组件

7)"骆驼在行动"一书中的第12章也有一些细节:http://manning.com/ibsen/

8)还有一个日志组件,可以使用组大小/组间隔选项http://camel.apache.org/log记录性能

9)还有跟踪器,它也可用于跟踪和测量路由的性能http://camel.apache.org/tracer


Ala*_*ter 7

你在这里有很多选择,包括追求你最初的想法

1)你可以轻松地挂钩Camel的EventNotifier,这里有一个基本的例子http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html

INFO  CamelContextFactoryBean        - Using custom EventNotifier with id: myLoggingEventNotifier and implementation: org.apache.camel.processor.MyLoggingSentEventNotifer@76bf9e
INFO  MyLoggingSentEventNotifer      - Took 1001 millis to send to: Endpoint[direct://bar]
INFO  MyLoggingSentEventNotifer      - Took 0 millis to send to: Endpoint[mock://result]
INFO  MyLoggingSentEventNotifer      - Took 1013 millis to send to: Endpoint[direct://start]
Run Code Online (Sandbox Code Playgroud)

2)您可以使用Fuse IDE,例如 http://fusesource.com/docs/ide/2.1/tutorials/RiderTutorialTrace.html

3)您可以使用JMX连接到您的Java实例,并且可以从那里获取大量信息