A REST API that can be used a central point for collecting metrics from pytest-monitor.
Project description
monitor-server-api
Features
For short, monitor-server-api helps you to collect, historicize and exploit the data from your tests written with pytest and monitored with pytest-monitor.
- Centralize your tests results
- bring support for pytest-xdist and pytest-parallel
- Easy data querying through specific queries
- Integrated library for in-script queries
Usage
The server can be launched easily with any WSGI Framework. The following lines can be used for a start:
bash $> # Use it with sqlite (not recomended for production)
bash $> export DATABASE_PATH=/path/to/sqlite/db
bash $> uwsgi --http 0.0.0.0:8050 --workers 8 --process 8 --master
--harakiri 60 --harakiri-verbose --need-app -w monitor_server_api.uwsgi
--callable WSGI_SERVER --env DATABASE_PATH=${DATABASE_PATH} --env ENV=prod
If you prefer using conda
bash $> conda activate <your monitor-server-api env>
bash $> launch-monitor-server.sh -p 8080 -t 60 -w 8 -u sqlite:////path/to/db
You can validate that the server runs correctly by going to the root page of the server.
Documentation
A full documentation with use cases and example is available.
Installation
Review the following installation instructions along with basic setup instructions.
You can install monitor-server-api via conda (through the conda-forge
channel):
$ conda install monitor-server-api -c https://conda.anaconda.org/conda-forge
Another possibility is to install monitor-server-api via pip
_ from PyPI
:
$ pip install monitor-server-api
Requirements
Monitor-Server-Api
To run, the monitor-server-api requires a valid Python 3.6+ interpreter. The following requirements are needed:
- flask-restx (officially supported) OR flask-restplus (tested)
- flask-sqlalchemy
Testing requires pytest-flask and pytest-cov (along with pytest obviously).
Monitorlib
The monitorlib also requires a valid Python 3.6+ along with :
- requests
- pandas
Contributing
Contributions are very welcome. Tests are run with pytest. Before submitting a pull request, please ensure that:
- both internal tests and examples are passing.
- internal tests have been written if necessary.
- if your contribution provides a new feature, make sure to provide an example and update the documentation accordingly.
Issues
If you encounter any problem, please file an issue along with a detailed description.
See contributing file for more information.
License
monitor-server-api is free, open-source software This code is distributed under the license.
Author
The main author of monitor-server-api
is Jean-Sébastien Dieu, ]]who can be reached at dieu.jsebastien@yahoo.com.
See AUTHORS file for more contributors.
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
Built Distribution
File details
Details for the file monitor-server-api-1.0.0.tar.gz
.
File metadata
- Download URL: monitor-server-api-1.0.0.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ef28cf26db464e65160b6672650d36de0cceaae9004777bd2d238a712e2785f |
|
MD5 | 246a15525193fb6b3618afc4c151335f |
|
BLAKE2b-256 | f87dd516de49b87f96f1212de5dcd15ea02568056c922c9ab6d2a363a1ba41cc |
File details
Details for the file monitor_server_api-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: monitor_server_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 50.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afe94239cca316f6ed554180eb92611e3958141d81b84255c30e3d7306366f34 |
|
MD5 | 481a1781724838badf97ab98361c6508 |
|
BLAKE2b-256 | c56f96d668a53cdb1f341ae7f27faff10d14622e9e4e8a226fe8aa8b162cf971 |