1 - Installation

    • Create a directory on the server
    • Copy the archive on it
    • Unpack it
    • Verify the java version (minimum 1.4.*)
    • And start the agent ./startAgent.sh
[oracle@Exalytics-01 JMeterServerAgent]$ ./startAgent.sh
INFO 2013-04-17 15:34:57.469 [kg.apc.p] (): Binding UDP to 4444
INFO 2013-04-17 15:34:58.468 [kg.apc.p] (): Binding TCP to 4444
INFO 2013-04-17 15:34:58.471 [kg.apc.p] (): JP@GC Agent v2.2.0 started

2 - Usage and commands

Test it with telnet:

Using username "oracle".
Last login: Wed Apr 17 15:32:18 2013 from 192.168.7.128
[oracle@Exalytics-01 ~]$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
test
Yep
exit
Connection closed by foreign host.

Possible commands are:

  • exit - terminates current client session and closes connection to agent, no parameters
  • test - test if server is alive, no parameters
  • shutdown - terminate all client connections and shutdown agent process, no parameters
  • interval - change metrics reporting interval used in 'metrics' command, single parameter is integer value in seconds. Interval can be changed in the middle of metrics reporting. Example: interval:5
  • metrics - starts automatic metrics collection, parameters are metrics list to collect, described below. Example: metrics:cpu
  • metrics-single - calls single metric collection iteration.
metrics-single:memory
82.40174605900177
metrics-single:cpu memory
1.743090990034588 82.40096038578609

cpu and memory are separated with a tab.

Each metric specification consists of several fields, colon-separated. Short example:

metrics-single:cpu:idle memory:free
98.33814099619674 4.8909893632E10

Fields number is metric-type specific. Possible metric types are:

  • cpu
  • memory
  • swap
  • disks
  • network
  • tcp
  • tail
  • exec
  • jmx

exec: ServerAgent can be shell exec vulnerability.

metrics-single:exec:/bin/sh:-c:free | grep Mem | awk '{print $7}'
1152488

2.1 - PerfMon Metrics Collector Listener

Version 0.5.0 ships new ServerAgent which provide over 75 separate metrics, support per-process CPU and Memory metrics and even custom metrics for measuring whatever you want: file sizes, database row counts, Java heap sizes and garbage collections.

It reads jppm files (JPPM=JMeter Plugins Peformance Monitoring). In command line, you can specify “-Jjppmfile=/path/to/file.jppm”. If nothing is specified, a file is created in the running path of JMeter, named perfmon_yyyyMMdd-HHmmss.jppm.

2.1.1 - Metric Parameter

PerfMon Metrics Collector has special “Metric Parameter” column, where user can specify metric subtype to collect, specify which process should be monitored (which filesystem, network interface). Metric parameter string may have several parameters inside it, separated with colon :. To include colon as a char inside parameter, use backslash escaping \:. Make note you cannot use tab characters inside metric parameter string, all tabs will be converted to spaces silently.

Selector / Filter parameter

  • name, pid and ptql for processes
  • core for monitoring specific CPU of multicore systems
  • fs for filesystems
  • iface for network interfaces
Metric to collect Parameter Description
CPU combined measure total CPU usage, equals to 100-idle value
CPU core=2:user measure user process CPU usage for third core in system (core numbering starts at 0)
CPU name=java#2:user will monitor second java process instance for user time spent
CPU pid=14523:percent will monitor process with PID 14523 for total CPU usage percentage
CPU name=httpd omitting metric type will use default 'percent'
Disk IO fs=/home:writes will monitor /home filesystem for number of write operations
Network IO iface=eth0:tx will monitor interface eth0 for transmitted packet rate

Server Agent has special command-line option –sysinfo for printing available processes, filesystems and network interfaces together with their selectors.

2.1.2 - Metrics

 
2.1.2.1 - CPU

Generally it is never possible for user processes to consume ALL of the CPU because as its load increases so does the load from other types of CPU usage.

How a particular server uses its CPU depends on a number of factors but in general the real metric we use to determine CPU usage is the idle time.

This is the metric that alerts are based from. The idle value is the amount of CPU left not doing any work. If CPU has no idle time it is 100% in use - how that is allocated depends on the server architecture and the application. In some cases it might be all User, System, and Steal. If it is doing a massive database backup it might all be in wait. It just depends.

The cpu metrics are a combination of many CPU values and the “total” of those will add up to 100%.

Scope Type CPU Metrics Description
Total Primary combined measure total CPU usage, equals to 100-idle value
Total Primary idle CPU not doing any work
Total Primary system CPU used by the operating system (kernel) itself and its associated processes. (things like RAID rebuilding, and handling network transmission and checksums fall into this category as well)
Total Primary user Time the CPU has spent running users'processes. CPU used by user applications
Total Primary iowait (of wait) CPU waiting for disk IO operations to complete. Time that the CPU is idle and there is at least one input or output operation in progress
Total Additional irq interrupt request - CPU allocated to hardware interrupts
Total Additional nice CPU used to allocate multiple processes demanding more cycles than the CPU can provide
Total Additional softirq CPU servicing soft interrupts
Total Additional stolen  
2.1.2.2 - IO

The nature for disk read/write metrics is that OS have them counted in a deferred manner. So you may have no IO figures for some time, then all accumulated operations data. Usually this is seen as spikes at IO graphs. On linux there is some OS options in sysctl to change this behavior.

3 - Documentation / Reference

4 - Support

 

4.1 - liblibsigar-x86_64-linux.so: cannot open shared object file

1 [main] DEBUG Sigar  - liblibsigar-x86_64-linux.so: liblibsigar-x86_64-linux.so: cannot open shared object file: No such file or directory
org.hyperic.sigar.SigarException: liblibsigar-x86_64-linux.so: liblibsigar-x86_64-linux.so: cannot open shared object file: No such file or directory
at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)
at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at kg.apc.perfmon.PerfMonWorker.<init>(PerfMonWorker.java:54)
at kg.apc.perfmon.AgentTool.getWorker(AgentTool.java:90)
at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:23)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:175)

CPU Architecture Information:

[gerard@Exalytics-01 ~]$ uname -p
x86_64

Java (Via JConsole)

Architecture: 
amd64

Java Version

[gerard@Exalytics-01 ~]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Solution:

  • copy the file liblibsigar-amd64-linux.so into liblibsigar-x86_64-linux.so

本文转自:  清明-心若淡定   https://www.cnblogs.com/saryli/p/6605087.html

JMeter - Perfmon - ServerAgent的更多相关文章

  1. jmeter—PerfMon Metrics Collector(附java.io.IOException: Agent is unreachable via TCP错误解决办法)

    jmeter—PerfMon Metrics Collector(附java.io.IOException: Agent is unreachable via TCP错误解决办法 转自https:// ...

  2. jmeter修改ServerAgent的默认端口号

    jmeter修改ServerAgent的默认端口号 1 java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 5555 --tcp-port ...

  3. Jmeter 之 ServerAgent 在性能测试的时候通过插件监听数据库状态

    https://jmeter-plugins.org/downloads/old/ 下载几个jar包,导入到Jmeter对应到目录下/lib/ext文件夹下,注意只支持Jmeter3.2(不含)以下版 ...

  4. JMeter PerfMon Metrics Collector性能监控插件

    官方文档地址https://jmeter-plugins.org/wiki/PerfMon/ JMeter是一款压力测试工具,我们也可以用它来监控服务器资源使用情况. JMeter正常自带可以通过To ...

  5. 基于jmeter+perfmon的稳定性测试记录

    1. 引子 最近承接了项目中一些性能测试的任务,因此决定记录一下,将测试的过程和一些心得收录下来. 说起来性能测试算是软件测试行业内,有些特殊的部分.这部分的测试活动,与传统的测试任务差别是比较大的, ...

  6. jmeter之ServerAgent监控资源

    对linux服务器的服务进行压测时,服务器的运行情况可以通过添加插件来观察,而不用使用top命令实时的去看 1.资源准备 2.环境准备 3.资源监控 1.资源准备 可通过该网址下载jmeter所有插件 ...

  7. 23. Jmeter使用ServerAgent对服务器进行性能监控

    我们在做服务器性能测试的时候,往往会考虑四个点:CPU.网络.磁盘.内存.一般情况下是使用Linux命令进行监控,那么jmeter可否做到呢?答案是可以的,闲话不多说,进入正题. 环境准备 jmete ...

  8. 『动善时』JMeter基础 — 61、使用JMeter监控服务器

    目录 1.监控插件安装 2.启动监控服务 3.使用JMeter监控服务器 (1)测试计划内包含的元件 (2)HTTP请求界面内容 (3)配置jp@gc-PerfMon Metrics Collecto ...

  9. jmeter 分布式疑难杂症 待完善

    完善中....(可能不会完善了) 前景:在window调度机上配置好了jmeter相关的 jmx文件,因需搞分布式所以弄了几台linux. 但是jmx文件请求包含有bean shell脚本,需导入ja ...

随机推荐

  1. 50_流程控制函数-case结构

    case函数的使用一:switch case 的效果 /* Java中 switch(变量或表达式){ case 常量1:语句1:break: ... default:语句n;break; } MyS ...

  2. java学习笔记21(迭代器)

    java中有很多集合,内部有各种的存储的方法,取出的方法也各不相同,那么有没有一种通用的方法来取出来呢? java提供的遍历集合元素的方法有两种: 1.for-each结构(增强型for循环) 格式: ...

  3. PAT 乙级 1056. 组合数的和(15)

    给定N个非0的个位数字,用其中任意2个数字都可以组合成1个2位的数字.要求所有可能组合出来的2位数字的和.例如给定2.5.8,则可以组合出:25.28.52.58.82.85,它们的和为330. 输入 ...

  4. 【webdriver自动化】使用数据驱动的方式实现登录多个163账号

    练习1:使用数据驱动的方式,登录多个邮箱账号 login_info.txt: youxiang_99@163.com,XXXX youxiang_100@163.com,XXXX main.py: f ...

  5. Spring Boot 揭秘与实战 源码分析 - 工作原理剖析

    文章目录 1. EnableAutoConfiguration 帮助我们做了什么 2. 配置参数类 – FreeMarkerProperties 3. 自动配置类 – FreeMarkerAutoCo ...

  6. Spring Boot 揭秘与实战(五) 服务器篇 - Tomcat 代码配置

    Spring Boot 内嵌的 Tomcat 服务器默认运行在 8080 端口.如果,我们需要修改Tomcat的端口,我们可以在 src/main/resources/application.prop ...

  7. 数据结构与算法Java描述 队列

    package com.cjm.queue; /** * 数据结构与算法Java实现 队列 * * @author 小明 * */ public class Myqueue { private Nod ...

  8. 九度OJ1111题-单词替换

    题目1111:单词替换 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6752 解决:1891 题目描述: 输入一个字符串,以回车结束(字符串长度<=100).该字符串由若干个单词组 ...

  9. [LeetCode&Python] Problem 350. Intersection of Two Arrays II

    Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...

  10. How to do distributed locking

    How to do distributed locking 怎样做可靠的分布式锁,Redlock 真的可行么? 本文是对 Martin Kleppmann 的文章 How to do distribu ...