轉:JMeter整合InfluxDB,Grafana讓測試結果實時顯示

軟件版本: 
apache-jmeter-2.13.tgz 
grafana-2.1.1-1.x86_64.rpm 
influxdb-0.8.8-1.x86_64.rpm 
雖然官方不在支持influxdb-0.8.8版本了,可是jmeter的文檔用的這個版本,因此我也用了這個版本html

【重要體會】,玩弄一個新的軟件,最好將其日誌調整的越豐富越好,這樣能夠發現不少問題數據庫

安裝步驟:

安裝influxdb 
wget  https://dl.influxdata.com/influxdb/releases/influxdb-1.1.0.x86_64.rpm
yum localinstall influxdb-1.1.0.x86_64.rpm 
修改/opt/influxdb/current/config.toml 
[input_plugins.graphite] 
enabled = true 
address = 「192.168.14.135」 # If not set, is actually set to bind-address. 
port = 2003 
database = 「jmeter」 
而後執行./influxdb -config=config.toml 啓動服務器apache

瀏覽器執行http://192.168.14.135:8083/ 用戶名和密碼root:root就能夠進入influxdb管理界面,建立Jmeter數據庫瀏覽器

安裝grafana 
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x86_64.rpm
yum localinstall grafana-4.2.0-1.x86_64.rpm 
systemctl start grafana-server 
瀏覽器指向http://192.168.14.135:3000/ , 默認用戶名和密碼是admin:admin 
按照官方步驟建立一個數據源 
建立一個dashboard, home->下拉框->new 
選擇監控圖的標題->編輯->Metrics-Series欄輸入jmeter.login.a.max表示咱們要監視全部採樣(sampler)的最大響應時間服務器

Jmeter 配置: 
添加一個Backend Listener 監聽器 
配置以下: 
graphiteHost: graphite服務器的地址,其實指向的是influxdb, 由於inffuxdb有個graphite插件 
graphitePort: graphite服務器的端口, 咱們在上面的input_plugins.graphite中配置信息 
rootMetricsPrefix:前綴」meter.」, 注意」.」是必須的 
summaryOnly:false, 統計詳細信息 
samplersList: 採樣器列表, 你添加的sampler的名字, 
percentiles:額外的百分比Metrics插件

Grafana dashboard

效果圖日誌

參考文檔:

http://docs.grafana.org/datasources/influxdb/ 
http://docs.grafana.org/datasources/influxdb/ 
http://jmeter.apache.org/usermanual/realtime-results.htmlserver

 

原文:http://ju.outofmemory.cn/entry/201105htm

相關文章
相關標籤/搜索