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 Distribution
Hashes for locust_influxdb_listener-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d537d5d3560c5c789bfb6e31b505ac37f817c66142c3766b0870102c78000532 |
|
MD5 | 2d64c65552db98cf184bcfebcb75bf4c |
|
BLAKE2b-256 | 2641398c7b2612567e1dd4e134fdafc5ad5a22127cd1ddc98c6a5e96a77fdb86 |
Hashes for locust_influxdb_listener-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16a943fb9040eb9842058fd39527897f5c61521e00e4a364868429942e11fd03 |
|
MD5 | 73f1e016e7dcd5341725e197ab90cf82 |
|
BLAKE2b-256 | 7b95e39c44eb1076e86336bab0b990ec903d6e34500f20872d7096aef31fa742 |