2008-01-07

TPTP agent-controller 配置

 配置AgentController以profilejava程序.(用eclipse callisto版本的tptp)
先设置AGENT_HOME=D:\dev\eclipseCallisto\plugins\org.eclipse.hyades.execution.win32.x86_4.2.2.v200701141614
然后在jboss启动里加上下面的参数:
-XrunpiAgent:server=standalone,filters=tptp.profile.filters.txt,file=profilejboss.trcxml
启动程序, 然后打开eclipse, 通过远程方式连1002端口就可以了.

其中tptp.profile.filters.txt是用来过滤profile的对象的, 内容/格式如下:
com.eha.*   *    include
*           *    exclude
包名   函数名  过滤掉/包含

其中profilejboss.trcxml是在"standalone"模式下, 收集的数据, 这个可以被eclipse tptp打开.

最后说一下agent:server的4种模式:standalone, enabled, controlled, application
stantalone, 不需要通过eclipse做什么事, 完全独立运行, 最后会得出一个*.trcxml文件, 保存了profile的数据.
enabled, 默认的, 只有客户端请求时才采集数据, 否则什么也不做.
controlled, 加载agent的时候会暂停正常的java程序, 直到有客户端连上agent:server为止才恢复java程序运行.
application, 跟enabled没啥区别.
除了standalone模式外, 其它的都只根据请求产生xml片断(fragment).

No comments: