2017-10-12 23 views
0

Ma question a déjà été posée mais je n'ai pas réussi à résoudre mon problème.Comment puis-je écrire dans InfluxDB à partir de Gatling?

Je n'arrive pas à envoyer mes données de Gatling en temps réel à InfluxDB.

Je suis sur Windows 10. Version Gatling: 2.3.0 (la dernière). Version InfluxDB: 1.3.5 (la dernière version est 1.3.6).

Mon 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 
    } 
    } 

Mon 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" 
    ] 

Ma base de données est créée sur gatlingdb InfluxDB, il reste vide.

Lorsque je tente:

C:\InfluxDB-1.3.5-1>influx -host 127.0.0.1 

Je suis connecté à InfluxDB

>USE gatlingdb 

Je suis connecté à ma base de données. Puis:

>SHOW SERIES 

et

>SELECT * FROM gatling 

Ne pas retourner quoi que ce soit. C'est vide.

Note: Je mets « DE gatling » parce que je mets dans mon gatling.conf: rootPathPrefix = « gatling »

Je ne télécharger Graphite mais j'ai vu que InfluxDB accepter le protocole de graphite. Je suppose que je peux envoyer des données de Gatling à InfluxDB. J'ai certainement raté quelque chose.

J'ai réussi à connecter InfluxDB à Grafana et j'affiche des données provenant d'autres bases de données. J'ai juste raté la connexion entre Gatling et InfluxDB.

Merci d'avance pour votre aide, j'en ai définitivement besoin!

Anthony

Répondre

0

Je suis presque terminé l'article qui montre toutes les étapes nécessaires pour créer toute l'infrastructure de surveillance à l'aide de la Gatling, Grafana et InfluxDB (BTW, sans graphite installé séparément), qui a travaillé très bien pour moi. Je pense que je vais le publier sur mon blazemeter.com dans quelques jours! Alors restez à l'écoute là-bas! http://blazemeter.com/blog

Vous y trouverez même la solution prête pour tout faire tourner à l'intérieur du Docker.

Mais jusqu'à ce (s'il est urgent pour vous), peut partager ma section de configuration 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 
} 

La première chose que vous devez vérifier est que InfluxDB accepte les métriques entrantes via le protocole graphite.Par exemple, pendant les journaux de démarrage InfluxDB, vous devriez trouver cette ligne:

influxdb_1 | [I] 2018-01-26T13:40:37Z Listening on TCP: [::]:2003 service=graphite addr=:2003