监控分为两方面:
1.监控指标
监控Tomcat主要指标为两个参数:
- number of sessions per application
- number of threads in different statuses
可以通过下面的链接察看
http://{ServerNameOrIPaddress}:8080/manager/html session,
下边的地址可以通过 web_reg_save_param()参数扑获
web_reg_save_param("YuPara_ApplicationAtest_Sessions", "LB=path=/ApplicationAtest\">", "RB=</a>", LAST); |
如果获得 Thread 代码,输入如下地址
http://{ServerNameOrIPaddress}:8080/manager/status
通过如下代码扑火
web_reg_save_param("YuPara_Threads", "LB=<tr><td><strong>", "RB=</strong>", "Ord=All", // All occurrences of this parameter are captured LAST); |
最后利用
lr_user_data_point 函数把获得的数据输入到性能测试图谱中
2.监控代码
可以利用LoadRunner Diagnostics 监控