jmeter 监控服务器的内存,cpu等内容
1、需要下载一个jar包,放入到lib /ext文件中 JMeterPlugins-Standard.jar
2、在服务器上安装 perfmon server agent
这里监控内存我们使用的是:jp@gc - PerfMon Metrics Collectot
在使用之前,我们需要运行/serverAgent/startAgent.bat这个文件,我们需要将serverAgent目录及下面的文件复制到我们测试的服务器上,然后点击打开
3、 创建监控器时选择如图:
PerfMon Server AgentInstallationYou do not need any root/admin privilege. You can just unzip the the ServerAgent-X.X.X.zip somewhere on the server. Then launch the agent using startAgent.sh script on Unix, or startAgent.bat script on Windows. The agent is written in Java, so you will need JRE 1.4+ to run it. Note you can create yourself the agent package which includes its own JRE so you don't have to install java on the server (We tested it on windows platform). To do this, just create a JRE folder in the agent folder and copy one installed JRE inside. Change the java command inside the .bat file to the path to the java executable and it will work. Once the agent is running, you can use the PerfMon Metrics Collector Listener to connect to the agents. You can add multiple servers to monitor, one graph can display several kinds of metrics (cpu, memory, etc...), auto-zooming rows for best view. UsageTo start the agent, simply run startAgent bat/sh file. It will open UDP/TCP server ports where JMeter will connect and query the metrics. Some information will be printed to standard output, informing you on problems gathering metrics (logging verbosity regulated with --loglevel parameter). You can specify the listening ports as arguments (0 disables listening), default is 4444: $ ./startAgent.sh --udp-port 0 --tcp-port 3450 You can use the --auto-shutdown option when starting the agent to automatically stop it once the test is finished. It is recommended to use this feature only with TCP connections: $ undera@undera-HP:/tmp/serverAgent$ ./startAgent.sh --udp-port 0 --auto-shutdown You can use the --sysinfo option to view available system objects: $ ./startAgent.sh --sysinfo The --interval <seconds> argument can be used to change metrics collection frequency. Using Server Agent With Other ApplicationsServer Agent uses simple plain-text protocol, anyone can use agent's capabilities implementing client, based on kg.apc.perfmon.client.Transport interface. If anyone's interested, start the topic on the support forums and I'll describe how to connect third-party client app to agent. ServerAgent has simple text protocol and can work on UDP and TCP transports. Most of cases will use TCP. To have your first talk with the agent, start it locally. Then use telnet utility to connect to it: user@ubuntu:~$ telnet localhost 4444 If connection has succeeded, you should see "Accepting new TCP connection" message in ServerAgent console log. Type "test" and press Enter in telnet chat, server should answer with short "Yep": test Type "exit": exit That's it. You sending a command line, server answering. Command line consists of command, sometimes with parameters. Parameters are separated from command with a colon sign. Possible commands are:
Specifying MetricsMetrics list consists of metric specifications, separated by TAB character. Metric collection output consists of float values, TAB separated. Example: metrics-single:cpumemory Each metric specification consists of several fields, colon-separated. Short example: metrics-single:cpu:idle memory:free Fields number is metric-type specific. Possible metric types are:
Fields corresponding to each metric type are described at metrics page. Last example (Yep, ServerAgent can be shell exec vulnerability. If you have issue with this, ask me and I'll introduce 'secure' mode, disabling insecure metric types): metrics-single:exec:/bin/sh:-c:free | grep Mem | awk '{print $7}' |
最新文章
- Web jquery表格组件 JQGrid 的使用 - 8.Pager、新增数据、查询、刷新、查看数据
- pyodbc不支持使用%,应该使用?
- sicily1024 Magic Island(图的遍历)
- IOS第13天(1,私人通讯录,登陆功能,界面的跳转传值,自定义cell,编辑界面)
- yii2.0 gii
- python脚本工具-2 去除扩展名后提取目录下所有文件名并保存
- 判断Table表中是否含有某一列
- C#笔记(二)变量之预定义的引用类型
- C# 三角形外心和外接圆半径计算方法
- Footer固定在页面底部(CSS)
- Linux工具XFTP、Xshell(centos配置java环境 工具篇 总结一)
- vue路由跳转时判断用户是否登录功能
- tomcat启动报错Several ports (8080, 8009) required by Tomcat v6.0
- Uva 10550 Combination Lock
- bzoj4596[Shoi2016]黑暗前的幻想乡 Matrix定理+容斥原理
- [转]MySQL-死锁查询
- 2019省赛训练组队赛3.26周二---FJUT 2016
- 关于pythoh面向过程开发人员三步转面向对象的补充,再加一步,四步走战略。转面向对象也可以有固定公式。
- python函数的创建和函数参数
- IO读 BufferedReader+FileReader
热门文章
- abap 字符串处理
- 通过GP加载卫星云图-雷达图-降雨预报图
- SrsDataConnector The SQL Server Reporting Services account is a local user and is not supported.
- js基本算法:冒泡排序,二分查找
- Javascript 中的window.parent ,window.top,window.self 详解
- Tint(着色器)的兼容实现
- iOS iOS9.0 的CoreLocation定位
- git之一
- WPF学习之路(十二)控件(HeaderedContent控件)
- Python运算符,python入门到精通[五]