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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f02f57febe9a868a5da0dd07a053b33c9cd4c1de13862edeacdebee8f263f14 |
|
MD5 | d095a17e1f0a37231d144efe24484d82 |
|
BLAKE2b-256 | 9e1862d5178b0e3aae8f7eccfa61bdbc6d2d6687d4217688dcb92d8829c50f31 |
Hashes for locust_influxdb_listener-0.0.5-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67ae14205b3eb7f217747c3f5d88c23018e6039eecdc347f43178458a251bcd0 |
|
MD5 | fb6cbc7b34cabd373cd80448b1e1e5a6 |
|
BLAKE2b-256 | 7a267267f69855ba04cec29673cb988fd14318cb0e93cf5955f45c4e9d2b3fbc |
Hashes for locust_influxdb_listener-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f7612b31d586b3e671b79a28337b973b3c8c7e472325df81cfa06e5a31084b |
|
MD5 | aeb949907113937739fdb4562f4caa2b |
|
BLAKE2b-256 | 6da4dea7bfcdcd8cdbf96eb64d87857285c23c52d2d502824d55cf8f8eeb4f70 |