LoadRunner监控tomcat的代码
作者:网络转载 发布时间:[ 2014/5/4 11:05:37 ] 推荐标签:性能测试工具 LoadRunner tomcat
近想对tomcat的性能指标做监控,于是 想到loadrunner关联函数的用法,于是做了本次尝试,没想到效果还不错,所以拿出来供大家分享,通过本次测试发现,关联的作用太强大了~
Action()
{
double atof(const char *string);
web_reg_save_param("JVM_FreeMemory",
"LB=Free memory: ",
"RB= MB",
"Ord=1",
LAST);
web_reg_save_param("JVM_TotalMemory",
"LB=Total memory: ",
"RB= MB",
"Ord=1",
LAST);
web_reg_save_param("JVM_MaxMemory",
"LB=Max memory: ",
"RB= MB",
"Ord=1",
LAST);
web_reg_save_param("http_MaxThreads",
"LB=Max threads: ",
"RB= ",
"Ord=1",
LAST);
web_reg_save_param("http_CurrentThreadCount",
"LB=Current thread count: ",
"RB= ",
"Ord=1",
LAST);
web_reg_save_param("http_CurrentThreadBusy",
"LB=Current thread busy: ",
"RB= ",
"Ord=1",
LAST);
web_reg_save_param("http_MaxProcessingTime",
"LB=Max processing time: ",
"RB= ms",
"Ord=1",
LAST);
web_reg_save_param("http_ProcessingTime",
"LB=Processing time: ",
"RB= s",
"Ord=1",
LAST);
web_reg_save_param("http_RequestCount",
"LB=Request count: ",
"RB= ",
"Ord=1",
LAST);
web_reg_save_param("http_ErrorCount",
"LB=Error count: ",
"RB= ",
"Ord=1",
LAST);
web_reg_save_param("http_BytesReceived",
"LB=Bytes received: ",
"RB= MB",
"Ord=1",
LAST);
web_reg_save_param("http_BytesSent",
"LB=Bytes sent: ",
"RB= MB",
"Ord=1",
LAST);
web_set_user("tomcat", "123","10.40.15.8:8080");
lr_think_time(20);
web_url("status",
"URL=http://10.40.15.8:8080/manager/status",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_user_data_point("Tomcat JVM FreeMemory", atof(lr_eval_string("{JVM_FreeMemory}")));
lr_user_data_point("Tomcat JVM TotalMemory", atof(lr_eval_string("{JVM_TotalMemory}")));
lr_user_data_point("Tomcat JVM MaxMemory", atof(lr_eval_string("{JVM_MaxMemory}")));
lr_user_data_point("Tomcat http MaxThreads", atof(lr_eval_string("{http_MaxThreads}")));
lr_user_data_point("Tomcat http CurrentThreadCount", atof(lr_eval_string("{http_CurrentThreadCount}")));
lr_user_data_point("Tomcat http CurrentThreadBusy", atof(lr_eval_string("{http_CurrentThreadBusy}")));
lr_user_data_point("Tomcat http MaxProcessingTime", atof(lr_eval_string("{http_MaxProcessingTime}")));
lr_user_data_point("Tomcat http ProcessingTime", atof(lr_eval_string("{http_ProcessingTime}")));
lr_user_data_point("Tomcat http RequestCount", atof(lr_eval_string("{http_RequestCount}")));
lr_user_data_point("Tomcat http ErrorCount", atof(lr_eval_string("{http_ErrorCount}")));
lr_user_data_point("Tomcat http BytesReceived", atof(lr_eval_string("{http_BytesReceived}")));
lr_user_data_point("Tomcat http BytesSent", atof(lr_eval_string("{http_BytesSent}")));
return 0;
}
|
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。
相关推荐
使用loadrunner进行压力测试遇到的问题总结LoadRunner检查点loadrunner11的移动端性能测试之脚本录制验证LoadRunner对Ajax内容的校验LoadRunner使用代理录制脚本LoadRunner运行乱码解决方法LoadRunner利用代理模式录制手机脚本loadrunner11中java vuser引用jar包使用LoadRunner监控Windows资源LoadRunner小技巧集锦LoadRunner提高篇:插入检查点与关联函数loadrunner怎么解决录制完成后脚本为空LoadRunner判断是否服务器连接池瓶颈LoadRunner中对Https证书的配置Loadrunner入门篇-Vuser发生器LoadRunner录制手机APP脚本
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11热门文章
常见的移动App Bug??崩溃的测试用例设计如何用Jmeter做压力测试QC使用说明APP压力测试入门教程移动app测试中的主要问题jenkins+testng+ant+webdriver持续集成测试使用JMeter进行HTTP负载测试Selenium 2.0 WebDriver 使用指南