如何将 Gatling 性能结果推送到 EC2 Grafana/InfluxDB 实例



我已经启动了一个t2.micro Ubuntu 18.04 EC2实例,在这个EC2实例中,我手动安装了Grafana和InfluxDB。 Grafana 和 InfluxDB 都已成功安装,没有错误,但现在我期望的是当我在我的 Windows本地,结果应该被实时推送到InfluxDB,最终推送到Grafana

这是我对 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
#writePeriod = 5              # Write interval, in seconds
}
graphite {
light = false              # only send the all* stats
host = "http://ec2-54-67-97-86.us-west-1.compute.amazonaws.com"         # 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
}

问题是当我从本地运行加特林测试时,我在 influx 实例中看不到任何数据

ubuntu@ip-172-31-9-16:~$ influx -host ec2-54-67-97-86.us-west-1.compute.amazonaws.com                                                    Connected to http://ec2-54-67-97-86.us-west-1.compute.amazonaws.com:8086 version 1.7.7
InfluxDB shell version: 1.7.7
> show databases
name: databases
name
----
_internal
gatling
graphite
> use graphite
Using database graphite
> show series
key
---
X-Grafana-Org-Id:

有人可以帮助调试这个,为什么在influx DB上没有收到任何数据

我建议你检查一下你的石墨监听器。

为此,请打开influxdb.conf并找到[[graphite]]块。

对于默认设置,它应如下所示:

[[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",
"gatling.*.users.*.*measurement.simulation.measurement.request.field"
]

更多信息在这里: https://gatling.io/docs/current/realtime_monitoring/#influxdb

最新更新