LoadRunner监控tomcat (2012-10-25 14:01:42)转载▼

double atof (const char * string);
Action()
{  
  // 保存JVM内存数值
   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);

//保存http-8989连接数值
    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);
  //定义tomcat内存使用情况的监视器事务;
lr_start_transaction("status");
web_set_user("admin", "pass","localhost:8989");

web_url("status",
  "URL=http://localhost:8989/manager/status",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=",
  "Snapshot=t1.inf",
  "Mode=HTML",
  LAST);
lr_end_transaction("status", LR_AUTO);
//使用lr_user_data_point()添加数据到图表中去
    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;
}

LoadRunner监控tomcat的更多相关文章

  1. LoadRunner监控Tomcat的几种方法

    通过JConsole监控Tomcat 1.打开tomcat5的bin目录中的catalina.bat文件,在头部注释部分的后面加上: set JAVA_OPTS=%JAVA_OPTS% -Dcom.s ...

  2. LoadRunner如何监控Tomcat性能

    使用LoadRunner做性能测试,一般的直觉是LR只能完成脚本录制和编写模拟用户的请求行为,但是在某些情况下,要监控一些中间件或web服务器的性能时,就不能通过录制脚本来完成了,那么就需要手工来编写 ...

  3. LoadRunner 实现监控Tomcat

    LoadRunenr没有监控Tomcat的专用监控器,为了用lr达到监控tomcat的目的可以通过打开Tomcat自带的Status页面之后,利用lr的关联技术得到相关的数据,把数据输出到lr自定义的 ...

  4. LR如何监控tomcat性能

    使用LoadRunner做性能测试,一般的直觉是LR只能完成脚本录制和编写模拟用户的请求行为,但是在某些情况下,要监控一些中间件或web服务器的性能时,就不能通过录制脚本来完成了,那么就需要手工来编写 ...

  5. linux上监控tomcat down掉后自动重启tomcat

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 } p. ...

  6. LoadRunner监控Linux

    rstat协议允许网络上的用户获得同一网络上各机器的性能参数. 需要下载3个包:    (1)rsh-0.17-14.i386.rpm     (2)rsh-server-0.17-14.i386.r ...

  7. 运用JMX监控Tomcat/Java jvisualvm简要说明

    公司线上项目出现了java heap space 然后经过查询知晓了下面工具于是开始了尝试. visualvm能干什么:监控内存泄露,跟踪垃圾回收,执行时内存.cpu分析,线程分析... jvisua ...

  8. 【转】使用JDK自带jvisualvm监控tomcat

    转载地址: http://my.oschina.net/kone/blog/157239 jdk自带有个jvisualvm工具.该工具是用来监控java运行程序的cpu.内存.线程等的使用情况.并且使 ...

  9. Jconsole 监控tomcat

    通过jconsole监控可以获取监控tomcat的相关的数据信息 如何通过代码来获取其中的线程和内存状况呢? 首先要配置好jconsole监控的相关配置,一搜基本就是那一个, 配置配不好的话接下来的工 ...

随机推荐

  1. #!bin/sh是啥

    第一句的#!是对脚本的解释器程序路径,脚本的内容是由解释器解释的,我们可以用各种各样的解释器来写对应的脚本,比如说/bin/csh脚本,/bin/perl脚本,/bin/awk脚本,/bin/sed脚 ...

  2. 转载] magento 产品数据表结构

    原文地址:http://blog.sina.com.cn/s/blog_9302097a010120l4.html 数据库-- 产品数据库表结构分析 product 1数据库实体表:catalog_p ...

  3. 集训day15 t1 poj3728

    [问题描述] 有一颗n个节点的树 每个节点上都有许多奸商在卖东西,第i个奸商的理想价格为vi,即他会以vi的价格购买或卖出一件东西 有m个人希望从树上的某个点走到另一个点,问你在只进行一次买卖(每次仅 ...

  4. 2016noipday1t1玩具迷题结题报告

    经常读这个代码有益于比赛时想起一些思路.... day1t1,洛谷dalao称之为水题...??然后我去年还是没拿到分,就这个,我还就写了40%的数据,AC到40,然而这不是关键,注释了freopen ...

  5. java中的控制语句

    控制语句 1.1 顺序结构 (最常见的) 特点:代码从上往下依次执行 1.2 选择结构 : if 判断语句 : switch 判断语句: Switch语句使用的注意事项: 1.每一个语句结束后需要有一 ...

  6. Codeforces 915 G Coprime Arrays

    Discipntion Let's call an array a of size n coprime iff gcd(a1, a2, ..., an) = 1, where gcd is the g ...

  7. [Contest20171102]简单数据结构题

    给一棵$n$个点的数,点权开始为$0$,有$q$次操作,每次操作选择一个点,把周围一圈点点权$+1$,在该操作后你需要输出当前周围一圈点点权的异或和. 由于输出量较大,设第$i$个询问输出为$ans_ ...

  8. 【Heap-dijkstra】Gym - 100923B - Por Costel and the Algorithm

    algoritm.in / algoritm.out Even though he isn't a student of computer science, Por Costel the pig ha ...

  9. 关于SQL优化方面的一些总结

    在sql查询中为了提高查询效率,我们常常会采取一些措施对查询语句进行sql优化,下面总结的一些方法,有需要的可以参考参考. 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 ord ...

  10. 一个强大的UI node 抽象

    基于cocos2d -x的一个强大的 界面对象的基类 ---@type uinode ui 对象的抽象 --@usage -- 界面打开的执行流程 -- 带*的是可选重写的函数,不带*的为必须实现的 ...