如何从Gatling编写InfluxDB?
我的问题已经提出,但我没有成功解决我的问题。如何从Gatling编写InfluxDB?
我没有成功将我的数据从Gatling实时发送到InfluxDB。
我在Windows 10上。 Gatling版本:2.3.0(最后一个)。 InfortDB版本:1.3.5(最后是1.3.6)。
我gatling.conf:
data {
writers = [console, file, graphite] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite, jdbc)
console {
#light = false # When set to true, displays a light version without detailed request stats
}
file {
#bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes
}
leak {
#noActivityTimeout = 30 # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening
}
graphite {
#light = false # only send the all* stats
host = "127.0.0.1" # The host where the Carbon server is located
port = "2003" # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
#bufferSize = 8192 # GraphiteDataWriter's internal data buffer size, in bytes
#writeInterval = 1 # GraphiteDataWriter's write interval, in seconds
}
}
我influxdb.conf:
[http]
# Determines whether HTTP endpoint is enabled.
enabled = true
# The bind address used by the HTTP service.
bind-address = "127.0.0.1:8086"
###
### [[graphite]]
###
### Controls one or many listeners for Graphite data.
###
[[graphite]]
# Determines whether the graphite endpoint is enabled.
enabled = true
database = "gatlingdb"
# retention-policy = ""
bind-address = ":2003"
protocol = "tcp"
# consistency-level = "one"
templates = [
"gatling.*.*.*.*.measurement.simulation.request.status.field"
]
我gatlingdb数据库上InfluxDB创建,它保持为空。
当我尝试:
C:\InfluxDB-1.3.5-1>influx -host 127.0.0.1
我连接到InfluxDB
>USE gatlingdb
我连接到我的数据库。然后:
>SHOW SERIES
和
>SELECT * FROM gatling
不返回任何内容。它是空的。
注:我把“FROM加特林”因为我把我的gatling.conf:rootPathPrefix =“加特林”
我没有下载石墨,但我看到InfluxDB接受石墨协议。我假设我可以将数据从Gatling发送到InfluxDB。我当然错过了什么。
我成功地将InfluxDB连接到Grafana,并显示来自其他数据库的数据。我错过了Gatling和InfluxDB之间的联系。
在此先感谢您的帮助,我绝对需要它!
安东尼
我差不多完成了用于显示所有创建使用加特林,Grafana和InfluxDB整个监控基础架构所需的步骤文章(顺便说一句,而无需单独安装石墨),它的工作对我非常好。 我想我会在几天内将它发布到我的博客blazemeter.com上!敬请关注! http://blazemeter.com/blog
在那里你甚至会找到现成的解决方案来启动Docker中的所有东西。
但直到(如果是迫切需要你),可以分享我的InfluxDB配置部分:
[[graphite]]
enabled = true
bind-address = ":2003"
database = "graphite"
retention-policy = ""
protocol = "tcp"
batch-size = 5000
batch-pending = 10
batch-timeout = "1s"
consistency-level = "one"
separator = "."
udp-read-buffer = 0
gatling.conf:
graphite {
light = false # only send the all* stats
host = "localhost" # The host where the Carbon server is located
port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
bufferSize = 8192 # GraphiteDataWriter's internal data buffer size, in bytes
writeInterval = 1 # GraphiteDataWriter's write interval, in seconds
}
你需要检查的第一件事是, InfluxDB实际上通过石墨协议接受传入指标。例如,在InfluxDB启动日志期间,您应该找到以下行:
influxdb_1 | [I] 2018-01-26T13:40:37Z Listening on TCP: [::]:2003 service=graphite addr=:2003