Skip to main content

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.

Prerequisites

This package requires locustIO v1.5.0 or greater.

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:

  • 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.

Grafa Example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

locust_influxdb_listener-0.0.8.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file locust_influxdb_listener-0.0.8.tar.gz.

File metadata

File hashes

Hashes for locust_influxdb_listener-0.0.8.tar.gz
Algorithm Hash digest
SHA256 36d9ce91b5a4a6a008c40150cd96e472dc81a80dd224993542308e5dfd223c25
MD5 a70bcc0e353311dcad8f7cf321aaf066
BLAKE2b-256 4afd2ac421aa63b51152d4a47ff07ba1b6cdc6f8b22d235663eecc58de84d83f

See more details on using hashes here.

File details

Details for the file locust_influxdb_listener-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for locust_influxdb_listener-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b27e32db59e4238d6efbe694833e8c7e5c2867e6a98c038dacd046b7e9b75d
MD5 1af94fe79a4f27e3e641b7589e915092
BLAKE2b-256 583f81677072e83f78a2fa3d182e785fc13248b477402c8fe9e2574d59dc8779

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page