Report locust metrics to influxdb.
Project description
locust_influx
Send information about locust requests to influxdb.
Start a container of influxdb locally:
docker run -d --name influxdb -d -p 8086:8086
Start a container of grafana locally:
docker run -d --name grafana -d -p 3000:3000
Crete a new python venv:
pip install locust_influx
Create a test locustfile.py
from locust import TaskSet, HttpLocust, task
from locust_influx import expose_metrics
expose_metrics()
class MyTasks(TaskSet):
@task
def get_home(self):
self.client.get('/')
@task
def head_home(self):
self.client.head('/')
@task
def delete_home(self):
self.client.delete('/')
@task
def post_home(self):
self.client.post('/.')
@task
def put_home(self):
self.client.put('/')
class MyLocust(HttpLocust):
task_set = MyTasks
Run locust (Change the host to point to desired one):
locust -f ./locustfile.py --no-web --clients 10 --hatch-rate 1 --run-time 60s --host http://localhost:8080
Open your local grafana in the browser at http://localhost:3000/
Import new dashboard from locust_dashboard.json file.
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
locust_influx-0.0.1a1.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for locust_influx-0.0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63f954def1e3eb2d9dbe449ea6bdec1b89859248f4f7dc4bcd34f9cbb75a4f2e |
|
MD5 | 3d0f8c0713525ded046f1ff433c1f0fd |
|
BLAKE2b-256 | 8445876b80cf43283e3bd8424cd55db33016ccf99da5bb8f4797bd22ef376846 |