寫在前面的話, 做者認爲jmeter的監控被測服務器資源只是基本可用, 還好習慣了linux的各類命令和工具,因此也基本不用擔憂什麼了.可是有了圖形化的監控, 也方便給領導出報告. 怎麼說也是不錯的. linux
在準備正式開始性能測試時,發現,原有的服務器端性能監控的方案,沒法經過非GUI模式保存性能數據,並且所記錄性能數據比較單一,只有內存的使用狀況;因此嘗試其餘方法;web
找到的方法服務器
http://jmeter-plugins.org/wiki/PerfMonAgent/?utm_source=jpgc&;utm_medium=link&utm_campaign=PerfMonAgenttcp
是jmeter官方發佈的一個專門做用作web服務器性能監控的工具,包括兩部分,須要下載工具
JMeterPlugins-Standard-1.1.1.zip,性能
安裝到Jmeter以後就會多一個監視器測試
其次須要下載 ServerAgent-2.2.1.zipthis
這個是服務器代理,在須要監控的服務器上運行用來採集並向測試機發送服務器信息;spa
使用方法3d
$ ./startAgent.sh --udp-port 0 --tcp-port 3450 INFO 2011-11-25 19:02:14.315 [kg.apc.p] (): Binding TCP to 3450
下面是官網的簡介 jmeter很好很強大呀
Servers Performance Monitoringsince 0.3.0
Introduction
During a load test, it is important to know the health of the servers loaded. It is also nice to see if you are targeting a cluster if the load is correctly dispatched. To address this, the plugin package now supports server monitoring! Using it, you can monitor CPU, Memory, Swap, Disks I/O and Networks I/O on almost all platforms!
Here is how the plugin looks like. It shows the CPU usage of 4 servers involved in the load test:
Metrics collected
Since version 0.5.0 the Server Agent tool supports collecting over 75 system metrics. See full list.
How it worksConcept
JMeter cannot retrieve by default server metrics except Tomcat ones. To overcome this situation, we have developed a server agent which will get performance data for JMeter. The agent uses the SIGAR open source library. It is composed of a Java common part and native libraries per OS.
Installation
Server Agent tool detailed description is placed here.
UsageGUI Mode
In GUI mode, just add the listener, define servers and metric types to monitor, ensure the agent is running at remote server and is not blocked by a firewall, then run the test. The values will be displayed at real time chart.
Non GUI Mode
If you run JMeter in non GUI mode and want to save monitoring data to file, just configure result file saving in GUI as you do with other listeners. After running the test you may load saved file into GUI and see the values timeline.