Jmeter(四十九)jmeter+influxdb+Granfna集成win部署

其实很多时候,群众是很好说话的,因为他们所需要的并非特权,而是公平

                    --当年明月《明朝那些事儿》

 

由于是win本地部署,jmeter部署看前面文章即可,本篇主要记录influxdb+granfna

一、influxdb

1、influxdb官网下载win的安装包

2、解压至本地

3、修改配置文件,下载下来的配置文件为:influxdb.conf;一般win都推荐influxdb.config使用config后缀的配置,其实两种配置文件都试了试,都可用

4、修改配置文件内容,路径改成自己本地路径

meta部分:

[meta]
  # Where the metadata/raft database is stored
  dir = "D:\\usuallySoftwere\\influxdb-1.7.7-1\\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部分:

[data]
  # The directory where the TSM storage engine stores TSM files.
  dir = "D:\\usuallySoftwere\\influxdb-1.7.7-1\\data"

  # The directory where the TSM storage engine stores WAL files.
  wal-dir = "D:\\usuallySoftwere\\influxdb-1.7.7-1\\wal"

retention部分:

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

  # The interval of time when retention policy enforcement checks run.
  check-interval = "30m"

shard-precreation部分:

[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"

http部分:

[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"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false

  # The default realm sent back when issuing a basic auth challenge.
  # realm = "InfluxDB"

  # Determines whether HTTP request logging is enabled.
  # log-enabled = true

  # Determines whether the HTTP write request logs should be suppressed when the log is enabled.
  # suppress-write-log = false

  # When HTTP request logging is enabled, this option specifies the path where
  # log entries should be written. If unspecified, the default is to write to stderr, which
  # intermingles HTTP logs with internal InfluxDB logging.
  #
  # If influxd is unable to access the specified path, it will log an error and fall back to writing
  # the request log to stderr.
  # access-log-path = ""

  # Filters which requests should be logged. Each filter is of the pattern NNN, NNX, or NXX where N is
  # a number and X is a wildcard for any number. To filter all 5xx responses, use the string 5xx.
  # If multiple filters are used, then only one has to match. The default is to have no filters which
  # will cause every request to be printed.
  # access-log-status-filters = []

  # Determines whether detailed write logging is enabled.
  # write-tracing = false

  # Determines whether the pprof endpoint is enabled.  This endpoint is used for
  # troubleshooting and monitoring.
  # pprof-enabled = true

  # Enables a pprof endpoint that binds to localhost:6060 immediately on startup.
  # This is only needed to debug startup issues.
  # debug-pprof-enabled = false

  # Determines whether HTTPS is enabled.
  # https-enabled = false

  # The SSL certificate to use when HTTPS is enabled.
  # https-certificate = "/etc/ssl/influxdb.pem"

  # Use a separate private key location.
  # https-private-key = ""

  # The JWT auth shared secret to validate requests using JSON web tokens.
  # shared-secret = ""

  # The default chunk size for result sets that should be chunked.
  # max-row-limit = 0

  # The maximum number of HTTP connections that may be open at once.  New connections that
  # would exceed this limit are dropped.  Setting this value to 0 disables the limit.
  # max-connection-limit = 0

  # Enable http service over unix domain socket
  # unix-socket-enabled = false

  # The path of the unix domain socket.
  # bind-socket = "/var/run/influxdb.sock"

  # The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit.
  # max-body-size = 25000000

  # The maximum number of writes processed concurrently.
  # Setting this to 0 disables the limit.
  # max-concurrent-write-limit = 0

  # The maximum number of writes queued for processing.
  # Setting this to 0 disables the limit.
  # max-enqueued-write-limit = 0

  # The maximum duration for a write to wait in the queue to be processed.
  # Setting this to 0 or setting max-concurrent-write-limit to 0 disables the limit.
  # enqueued-write-timeout = 0

graphite部分:

[[graphite]]
  # Determines whether the graphite endpoint is enabled.
  enabled = true
  database = "jmeter"
  # retention-policy = ""
  bind-address = ":2003"
  protocol = "tcp"
  consistency-level = "one"

  # These next lines control how batching works. You should have this enabled
  # otherwise you could get dropped metrics or poor performance. Batching
  # will buffer points in memory if you have many coming in.

  # Flush if this many points get buffered
  # batch-size = 5000

  # number of batches that may be pending in memory
  # batch-pending = 10

  # Flush at least this often even if we haven't hit buffer limit
  # batch-timeout = "1s"

  # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
  # udp-read-buffer = 0

  ### This string joins multiple matching 'measurement' values providing more control over the final measurement name.
  # separator = "."

  ### Default tags that will be added to all metrics.  These can be overridden at the template level
  ### or by tags extracted from metric
  # tags = ["region=us-east", "zone=1c"]

  ### Each template line requires a template pattern.  It can have an optional
  ### filter before the template and separated by spaces.  It can also have optional extra
  ### tags following the template.  Multiple tags should be separated by commas and no spaces
  ### similar to the line protocol format.  There can be only one default template.
  # templates = [
  #   "*.app env.service.resource.measurement",
  #   # Default template
  #   "server.*",
  # ]

###
### [collectd]
###
### Controls one or many listeners for collectd data.
###

可以看到基本上都是对配置的打开,graphite部分和http部分涉及自定义配置

5、启动influxdb,指定配置文件

命令:influxd -config influxdb.config

6、启动成功

 

二、Granfna

1、官网下载win安装包

2、配置influxdb库信息(注意:库有设置密码就填入密码,未设置密码便不用填写,直接连接即可)

3、导入jmeter模板(模板很多,百度一下,或者官网查找)

 

三、jmeter配置

1、添加后置监听器进行配置

后端监听器实现选择:org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient

参数配置:

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

application :jmeter

measurement :jmeter

summaryOnly : false

samplersRegex :*

其余默认即可

配置完成。

 

 

posted @ 2022-10-31 17:19  紫陌花间客  阅读(115)  评论(1编辑  收藏  举报