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脚本后,可以看到加载的信息
作者:乔叶叶
博客地址:http://www.cnblogs.com/qiaoyeye/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
******************************************************************************************************************************************