Locust.io 1.X influxdb listener
Project description
locust-influxdb-listener
Package that uses locust 'event' hooks to push locust related events to an influxDB database.
Installation
Install using your favorite package installer:
pip install locust-influxdb-listener
# or
easy_install locust-influxdb-listener
Usage
Import the library and use the event.init
hook to register the listener.
...
from locust_influxdb_listener import InfluxDBListener, InfluxDBSettings
@events.init.add_listener
def on_locust_init(environment, **_kwargs):
"""
Hook event that enables starting an influxdb connection
"""
# this settings matches the given docker-compose file
influxDBSettings = InfluxDBSettings(
influx_host = 'localhost',
influx_port = '8086',
user = 'admin',
pwd = 'pass',
database = 'test-project'
)
# start listerner with the given configuration
InfluxDBListener(env=environment, influxDbSettings=influxDBSettings)
...
Example
You can find a working example under the examples folder
InfluxDB with Grafana
We have included a working example docker-compose.yml
file that can be used to spin a reporting setup in case you don't have one.
(Make sure you have docker
and docker-compose
installed and just run:
docker-compose up
Configuration
Once grafana is running (by default on port: 3000) https://localhost:3000
, you need to:
-
Connect to influxdb as the datasource:
- Host: https://influxdb:8086
- User: admin
- Password: pass
-
Import a new dashboard. We have provided a custom dashboard for you
locust-grafana-dashboard.json
that just works out of the box with the locust-events that the listener will emmit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for locust_influxdb_listener-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4decef11390d7b8cebad53d6a32fb1e468b24968dbd7a49e0ffd31503df3ebb1 |
|
MD5 | 044dcd3098eb68e1417c583775088edc |
|
BLAKE2b-256 | 1ec86358dceba7731d321be2c4fbdb1485a962f3ac1fbd69d032414de91273a1 |
Hashes for locust_influxdb_listener-0.0.4-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80d7717c6eae2625b6b4049279411bb810a90016c36bd8c243020b1f21c1f526 |
|
MD5 | f9832d50c5c50050eca5d8c3d779fe12 |
|
BLAKE2b-256 | b7374df51c9a837f5a2cb73956f3605ce2ef6c8a8f6941bd9a7aa83d627e271b |
Hashes for locust_influxdb_listener-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 276b9e36c9a349b9e6c80b8a08be405447b7a75e9dc776ba0fbbfc76b621cc65 |
|
MD5 | 526dd0cc117da5159daeee136882c2d3 |
|
BLAKE2b-256 | aeb61afea1ce84b1f3d099ab7b5b5a36f8c05d8a2e33ab7c1f19e578de761438 |