Console app and Python API for converting locust's load test CSV formatted reports into the OpenMetrics text format
Project description
About
Console app and Python API for converting locust’s load test CSV formatted reports into the OpenMetrics text format.
To use this tool effectively please setup your locust load tests to store test statistics in CSV format, which will then generate a number of files: {CSV_PREFIX}_stats.csv, {CSV_PREFIX}_stats_history.csv, {CSV_PREFIX}_failures.csv and {CSV_PREFIX}_exceptions.csv. Out of the files above, locust_csv2openmetrics is meant to work with only the {CSV_PREFIX}_stats.csv file.
Installation
To install locust_csv2openmetrics run:
$ pip install locust_csv2openmetrics
Console app usage
Quick start:
$ locust_csv2openmetrics <filename>
Show help:
$ locust_csv2openmetrics --help
Python API usage
Quick start:
>>> import locust_csv2openmetrics as lom >>> collector = lom.collect_locust_stats("examples/locust_stats.csv") >>> lom.write_openmetrics_to_textfile("./metrics.txt", lom.REGISTRY)
Contribute
If you find any bugs, or wish to propose new features please let us know.
If you’d like to contribute, simply fork the repository, commit your changes and send a pull/merge request.
Development process
Before you start you’ll need Make, Python and Poetry.
This project doesn’t require system wide installation, simply clone the repository and initialize its development runtime environment to get started:
$ git clone git@gitlab.com:360dialog/open-source/locust_csv2openmetrics.git $ cd locust_csv2openmetrics $ poetry install --with dev --sync
If you do not wish to install Make, Python or Poetry on your system you can use the dockerized version of this project instead, by replacing all of your make calls, such as:
$ poetry run make [quiet=1] [PYTHONWARNINGS=all] [TARGET] ...
with:
$ ./dockerized.sh [quiet=1] [PYTHONWARNINGS=all] [TARGET] ...
Show help:
$ poetry run make help # dockerized version: $ ./dockerized.sh help Usage: make [quiet=1] [PYTHONWARNINGS=all] [TARGET] ... Targets: help Display this help message test.unit Run the unit tests test.one Run only a specific unit test (module, module.TestCase or module.TestCase.test_method) test Run the entire test suite (unit tests, coverage, ...)
Run the test suite, please do this often during development:
$ poetry run make quiet=1 PYTHONWARNINGS=all test # dockerized version: $ ./dockerized.sh quiet=1 PYTHONWARNINGS=all test
Release process
This project’s release process is currently manual in its nature and attempts to mimic Django’s release process, as described in:
Its Python packages are hosted on PyPI, and this is how to build+publish its Python package on a new release:
$ poetry publish --build
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
File details
Details for the file locust_csv2openmetrics-1.0.0.tar.gz
.
File metadata
- Download URL: locust_csv2openmetrics-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.4 Linux/6.5.0-10008-tuxedo
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd8b6a7f59d1df8851afb31333be45d510b26c1a61472addbdecced3ea73ea68 |
|
MD5 | f8c708163f3ad247387a07f20c813b36 |
|
BLAKE2b-256 | 063df3cea456ea9f67d569d27a68f7448c3531bc05808d0595b8919b7dbb2051 |
File details
Details for the file locust_csv2openmetrics-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: locust_csv2openmetrics-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.4 Linux/6.5.0-10008-tuxedo
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38c90ae764184382f0f719fb355e0a6beabc3ec991c1759520a40de7410b280d |
|
MD5 | 55ab3d5d106fa1df5c516e9b7a0c5b25 |
|
BLAKE2b-256 | 7c2da015d566cac96123d8713c70d2301396b4dac5d7e75f75b951547055110f |