1.安裝環(huán)境:windows
2.所裝軟件如下:
influxdb1.4.2:是一個時間序列數(shù)據(jù)庫署咽,用于處理海量寫入與負載查詢
grafana5.4.2:是一個跨平臺的開源的度量分析和可視化工具起惕,可以通過將采集的數(shù)據(jù)查詢?nèi)缓罂梢暬恼故荆⒓皶r通知
telegraf1.9.1:是收集和報告指標和數(shù)據(jù)的代理阅束,這里主要用于監(jiān)控服務(wù)器的各項指標
chronograf1.7.2:可選,用來操作influxdb的工具宋渔,不安裝的話川陆,可以通過influxdb自帶的工具進行操作)
3、安裝步驟
influxdb
①解壓后胧奔,雙擊運行influxd.exe
②雙擊運行influx.exe
通過命令創(chuàng)建數(shù)據(jù)庫:
創(chuàng)建jmeter數(shù)據(jù)庫(用于存儲jmeter工具執(zhí)行的結(jié)果數(shù)據(jù))逊移,命令:create databases jmeter
查看數(shù)據(jù)庫命令:show databases
grafana
①解壓后,運行bin目錄下grafana-server.exe
②在瀏覽器輸入http://localhost:3000
③默認登錄賬號:admin龙填;密碼:admin
④創(chuàng)建數(shù)據(jù)源:
⑤導(dǎo)入模板(模板可去官網(wǎng)下載胳泉,json格式)
⑥運行jmeter,查看數(shù)據(jù)是否變化岩遗,若有數(shù)據(jù)扇商,則成功。
在jmeter中--添加--監(jiān)控器--Backend Listener
telegraf
①講文件夾放在對應(yīng)的服務(wù)器上
②在influx新建數(shù)據(jù)庫telegraf
③修改配置
# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
? ## The full HTTP or UDP URL for your InfluxDB instance.
? ##
? ## Multiple URLs can be specified for a single cluster, only ONE of the
? ## urls will be written to each interval.
? # urls = ["unix:///var/run/influxdb.sock"]
? # urls = ["udp://127.0.0.1:8089"]
? urls = ["http://localhost:8086"]? ? //此地址為influxdb的ip地址
如果想改變抓取數(shù)據(jù)頻率宿礁,則修改如下:
# Configuration for telegraf agent
[agent]
? ## Default data collection interval for all inputs
? interval = "2s"? //默認為10
? ## Rounds collection interval to 'interval'
? ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
? round_interval = true
? ## Telegraf will send metrics to outputs in batches of at most
? ## metric_batch_size metrics.
? ## This controls the size of writes that Telegraf sends to output plugins.
? metric_batch_size = 1000
? ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
? ## output, and will flush this buffer on a successful write. Oldest metrics
? ## are dropped first when this buffer fills.
? ## This buffer only fills when writes fail to output plugin(s).
? metric_buffer_limit = 10000
? ## Collection jitter is used to jitter the collection by a random amount.
? ## Each plugin will sleep for a random time within jitter before collecting.
? ## This can be used to avoid many plugins querying things like sysfs at the
? ## same time, which can have a measurable effect on the system.
? collection_jitter = "0s"
? ## Default flushing interval for all outputs. Maximum flush_interval will be
? ## flush_interval + flush_jitter
? flush_interval = "2s"? //默認為10
? ## Jitter the flush interval by a random amount. This is primarily to avoid
? ## large write spikes for users running a large number of telegraf instances.
? ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
? flush_jitter = "0s"
注:如果想修改jmeter抓取頻率則修改jmeter的配置文件:
Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode)
#---------------------------------------------------------------------------
#
# Comment the following property to disable the default non-GUI summariser
# [or change the value to rename it]
# (applies to non-GUI mode only)
summariser.name=summary
#
# interval between summaries (in seconds) default 30 seconds
summariser.interval=1? //改這里可以改變刷新頻率
#
# Write messages to log file
#summariser.log=true
在服務(wù)器上案铺,telegraf文件夾下,運行命令:telegraf -config telegraf.conf