I'm new to locust, influx and grafana and wanted to integrate locust with grafana for that, I have to use a time-based DB which was influx and wanted to store the locust data in influx DB. I have done some research online but no one has guided on how to do the same. Do I have to write some script for it or it is just some commands task. My grafana locust and influx is running fine in local env with the help of docker container.
Asked
Active
Viewed 931 times
0
-
Hi! I used to do something with Influx+Grafana, but switched to Timescale (Postgres). See https://github.com/SvenskaSpel/locust-plugins/blob/220520ec0ebc8192fcfa07e651dff8ade00623ff/locust_plugins/listeners.py#L37 for instructions, and https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/timescale_listener_ex.py for an example – Cyberwiz Jun 25 '20 at 16:53
-
1Thanks for your reply!! I did this to connect with the influx and added listeners later on, to save the data in it. `from influxdb import InfluxDBClient import socket hostname = socket.gethostname() client = InfluxDBClient(host="localhost", port="8086") client.switch_database('DemoDB') ` – Sayen Jul 16 '20 at 10:46
1 Answers
0
- In your Locus scripts you need to create two functions a) For Success b) For Failure
- Then assign these functions to Locus events.request_success, failure.
- Using InfluxDB client you can write the json points to influx db.
Please refer following link. https://www.qamilestone.com/post/real-time-monitoring-using-locust-with-influxdb-grafana
-
2Thanks for sharing this link, in fact I end up following the same and it did solve my problem 2 months back. – Sayen Aug 30 '20 at 13:37