Skip to main content

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

Metadata

Release files for locust_csv2openmetrics 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for locust_csv2openmetrics 1.0.0
File Size Uploaded
locust_csv2openmetrics-1.0.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for locust_csv2openmetrics 1.0.0
File Interpreter ABI Platform
locust_csv2openmetrics-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / locust_csv2openmetrics-1.0.0.tar.gz

Download URL locust_csv2openmetrics-1.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dd8b6a7f59d1df8851afb31333be45d510b26c1a61472addbdecced3ea73ea68
BLAKE2b-256 checksum
How to use checksums
063df3cea456ea9f67d569d27a68f7448c3531bc05808d0595b8919b7dbb2051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.4 Linux/6.5.0-10008-tuxedo

Release files / locust_csv2openmetrics-1.0.0-py3-none-any.whl

Download URL locust_csv2openmetrics-1.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38c90ae764184382f0f719fb355e0a6beabc3ec991c1759520a40de7410b280d
BLAKE2b-256 checksum
How to use checksums
7c2da015d566cac96123d8713c70d2301396b4dac5d7e75f75b951547055110f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.4 Linux/6.5.0-10008-tuxedo

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page