Jmeter+nfluxDB+Grafana性能監控平台


下載地址:

nfluxDB下載地址:https://portal.influxdata.com/downloads/

Grafana下載地址:https://grafana.com/grafana/download

nfluxDB配置:

打開/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/etc/influxdb/influxdb.conf,修改以下內容

[[graphite]]
  # Determines whether the graphite endpoint is enabled.
   enabled = true
   database = "jmeter"
  # retention-policy = ""
   bind-address = ":2003"
   protocol = "tcp"
   consistency-level = "one"
[meta]
  # Where the metadata/raft database is stored
  dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/meta
"

  # Automatically create a default retention policy when creating a database.
   retention-autocreate = true

  # If log messages are printed for the meta service
   logging-enabled = true
[data]
  # The directory where the TSM storage engine stores TSM files.
  dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/data"

  # The directory where the TSM storage engine stores WAL files.
  wal-dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/wal"

仍是data下面

 query-log-enabled = true
[retention]
  # Determines whether retention policy enforcement enabled.
   enabled = true

  # The interval of time when retention policy enforcement checks run.
   check-interval = "30m"
[shard-precreation]
  # Determines whether shard pre-creation service is enabled.
   enabled = true

  # The interval of time when the check to pre-create new shards runs.
   check-interval = "10m"

  # The default period ahead of the endtime of a shard group that its successor
  # group is created.
   advance-period = "30m"
[monitor]
  # Whether to record statistics internally.
   store-enabled = true

  # The destination database for recorded statistics
   store-database = "_internal"

  # The interval at which to record statistics
   store-interval = "10s"
[http]
  # Determines whether HTTP endpoint is enabled.
   enabled = true

  # Determines whether the Flux query endpoint is enabled.
   flux-enabled = false

  # Determines whether the Flux query logging is enabled.
  # flux-log-enabled = false

  # The bind address used by the HTTP service.
   bind-address = ":8086"

配置完成后,開始啟動,進入/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/usr/bin,執行

./influxd -config /Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/etc/influxdb/influxdb.conf

看到啟動界面,則表示啟動成功

新打開窗口,打開influxdb的客戶端,進入

/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/usr/bin,執行

 ./influx

 

新建數據庫 

create database jmeter

 

jmeter配置

jmeter添加Backend Listener,並選擇influxdbMetricsSender

 

influxdbUrl輸入:http://localhost:8086/write?db=jmeter

啟動jmeter腳本運行,查看結果是否入庫

回到終端命令行,輸入

use jmeter

查看庫里的數據記錄

 

select * from jmeter

 

 

配置grafana

進入grafana安裝目錄:

/Users/qiaojiafei/Documents/work/soft/grafana-6.1.6/bin,執行

./grafana-server

 

   瀏覽器打開地址:http://localhost:3000/login,賬號密碼均是admin,首次登錄需要修改密碼

登錄成功后,點擊左側的設置,點擊data source

選擇add data source

選擇influxdb

輸入influxdb的信息

 

 添加dashboards

也可以選擇import,導入,官方的模板可參考:https://grafana.com/dashboards?dataSource=influxdb,搜索框輸入jmeter

點擊進去后,點擊 copy id

粘貼copy的id,點擊load

選擇influxdb的相關信息,點擊import

執行jmeter腳本后,可以看到加載的信息

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM