zoukankan      html  css  js  c++  java
  • LoadRunner监控tomcat

    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;
    }

  • 相关阅读:
    C++如何在Dialog和View中显示梯度背景颜色
    C++MFC的关键类(View,Application,Frame,Document等等)之间访问方法列表
    C++深入分析MFC文档视图结构(项目实践)
    C++如何修改SDI程序的默认背景颜色
    BAPI使用HR_INFOTYPE_OPERATION函数批量导入HR信息纪录代码样例(0759信息类型)
    C++在单文档的应用程序增加多个视图
    SD定价过程的16个字段的作用说明
    HR上载信息类型的长文本的样例代码
    C++在工具条中加入组合框控件
    C++如何锁定splitter窗口
  • 原文地址:https://www.cnblogs.com/zhengah/p/4636264.html
Copyright © 2011-2022 走看看