2017-10-12 79 views
0

我的問題已經提出,但我沒有成功解決我的問題。如何從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之間的聯繫。

在此先感謝您的幫助,我絕對需要它!

安東尼

回答

0

我差不多完成了用於顯示所有創建使用加特林,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