Eclipse TPTP平台配置详细步骤Ver1.0

Eclipse TPTP平台配置详细步骤Ver1.0
一、 运行环境说明
JDK1.5及其以上版本
Window XP
Tomcat 5及其以上版本
二、 数据采集与分析平台搭建
Eclipse TPTP平台下载
下载网址:http://www.eclipse.org/tptp/home/downloads/
选择TPTP all-in-one package, Windows,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
下载后解压到任意目录下,里面带有Eclipse平台最新版本,TPTP all-in-one package已集成到Eclipse平台里面,无需作任何配置。

三、 远程监控服务Agent Controller的配置
1、 端口设置
远程受监控服务器需要打开10002、10003、10005、1006端口,用于监控数据传输。
2、 下载与TPTP平台版本的配匹Agent Controller
下载地址:http://www.eclipse.org/tptp/home/downloads/
选择Runtime:Windows IA32,点击下载按钮,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
下载的文件类似:agntctrl.win_ia32-TPTP-4.6.0.zip,将其解压到远程服务器上任一个目录下。
解压后的文件如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
3、 配置环境变量
将Agent Controller加入环境变量,在远程被监控服务器上加入以下环境变量:
TPTP_AC_HOME=D:\userdata \agntctrl.win_ia32-TPTP-4.6.0 (Agent Controller所在目录)
JAVA_PROFILER_HOME=%TPTP_AC_HOME%\plugins\org.eclipse.tptp.javaprofiler
Path变量里加入以下值:
%JAVA_PROFILER_HOME%;%TPTP_AC_HOME%\bin

4、 配置Agent Controller
运行Agent Controller\bin目录下的SetConfig.bat,
如:D:\userdata \agntctrl.win_ia32-TPTP-4.6.0\bin\SetConfig.bat,出现以下运行提示:

Specify the fully q lified path of "java.exe" (e.g. c:\jdk1.4\jre\bin\java.exe):
Default>"C:\Program Files\Java\jdk1.5.0_06\jre\bin\java.exe" (Press <ENTER> to
accept the default val)
New val>

提示指定JDK里java.exe的绝对路径。要与Tomcat里使用的java.exe保持一致,否则不能正常进行监控。如果无误,回车即可,进入下一步设置,出现以下提示:

Network access mode (ALL=allow any host, LOCAL=allow only this host, CUSTOM=list
of hosts):
Default>"ALL" (Press <ENTER> to accept the default val)
New val>

回车即可,允许所有客户端连接。进入下一步,出现以下提示:

Security enabled. (tr/false):
Default>"FALSE" (Press <ENTER> to accept the default val)
New val>

回车即可,关闭安全选项,所有设置完成,将在config目录下生成serviceconfig.xml配置文件。
如果前面指定的java.exe路径与tomcat所使用的java.exe路径不一致,修改serviceconfig.xml里
<Variable name="JAVA_PATH" position="replace" val="C:\Program Files\Java\jdk1.5.0_06\jre\bin\java.exe"/>

val的值即可。

5、 为Tomcat加入监控
www.apache.org 下载Tomcat5以上版本,解压到任意目录,打开Tomcat的解压目录,打开bin文件夹,找到catalina.bat文件,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
用任何文本编辑器打开catalina.bat文件,找到大概118行的位置,有“set JAVA_OPTS=”语句,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
在“set JAVA_OPTS=”这一行行末,加一个空格,不换行,添加以下任意一行语句:
-XrunpiAgent:server=enabled
保存,关闭文件,即可完成Tomcat的配置。

四、 使用TPTP进行性能监控
启动步骤:
1、 启动远程被监控机器10.10.11.56上的ACServer
在被监控的远程机器上,运行Agent Controller\bin目录下的ACServer.exe服务,启动监控服务,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
运行之后,出现以下命令行窗口,没有任何输出:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
2、 启动远程被监控机器10.10.11.56上的Tomcat:
运行tomcat\bin下的startup.bat启动Tomcat。
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
3、 启动本地监控与分析平台:
找到解压后的TPTP all-in-one package所在的目录,找到TPTP all-in-one package\eclipse目录,双击eclipse.exe运行。依次点击Window?Open Perspective?Other,打开后如图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
出现如下界面:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
选择Profiling and Logging,点击OK,打开监控与性能分析视图:

Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
找到下图所示位置的Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客 按钮,
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
点击下拉三角,出现下图所示菜单:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
点击Profile Configurations…菜单,出现Profile Configurations窗口,如下图所示:

Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客

选中Attach to Agent选项,点左上角的添加按钮Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
,位置如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
出现下图所示的配置界面:

Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
点击Add按钮,出现Add host弹出窗口,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
添加远程被监控主机的IP,端口号默认10002无需修改。
然后点击Test Connection,连接成功后,显示如下提示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
然后切换至Agents标签,点击Refresh按钮,在Agents视图下出现Java Profiling设置选项,
勾选Basic Memory Analysis、Execution Time Analysis和Method Code Coverage三个选项,最后一项Probe Insertion选项不要勾选,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
点击选中Java Profiling选项,然后单击右侧的Edit Options按钮,设置要监控的Java类,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
根据需要设置完成后,直接点Finish按钮结束设置。
然后选中Execution Time Analysis,再单击Edit Options按钮
出现Edit Profiling Options设置界面:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
勾选Collect method CPU time information选项,选中Show execution flow graphical details选择,点击Finish完成设置。
依次点击Apply?Profile,开始进行监控与分析。
4、 监控平台使用
监控平台打开后图面如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
在右侧面板所显示的监控服务中,在Execution Time Analysis上点击右键,选择Open With?Execution Statistics查看运行统计,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
出现服务运行统计示图:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
也 可以根据需要,查看Execution Flow、URM2 Class Interactions等其它视图,如UML图,在Execution Time Analysis上点右键,Open With?UML2Classic Interactions即可打开UML图查看类之间的调用关系。
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
五、 注意事项
1、 单击如下图所示的停止按钮Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客 ,远程服务器Tomcat将停止运行:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
2、 点击右键菜单里的Refresh Tree选项,如下图所示:
Eclipse TPTP平台配置详细步骤Ver1.0 - is00hcw - is00hcw的博客
将关闭监控与分析视图,远程Tomcat服务正常运行 ,但监控不到,要想重新监控,需要重新启动Tomcat服务器。
3、 修改Agent Server的配置文件serviceconfig.xml后,ACServer要重新启动才能生效。
4、 Execution Time Analysis,进行设置时,单击Edit Options按钮后,如果不选中Show execution flow graphical details选项,将不能查看UML视图。

猜你喜欢

转载自chenpingpi.iteye.com/blog/1202845