Skip to main content

A REST API that can be used a central point for collecting metrics from pytest-monitor.

Project description

monitor-server-api

CircleCI License Documentation Status PyPI PyPI - Python Version Anaconda-Server Badge Anaconda-Server Badge

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 $> # Setup the server to listen on port 8080, 8 workers, 60s max per request and using sqlite
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 MIT 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

monitor-server-api-1.0.1.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monitor_server_api-1.0.1-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file monitor-server-api-1.0.1.tar.gz.

File metadata

  • Download URL: monitor-server-api-1.0.1.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for monitor-server-api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3a9c778a77ca1b1f87b259a14b49f74c43dc374d2243e6b839a5ead507319304
MD5 9d093a561c5a5a97f8db2bdc75ac0a24
BLAKE2b-256 3e4ebb777f773669289028cb4c617d616969962169838099768ee756c5ecbc14

See more details on using hashes here.

File details

Details for the file monitor_server_api-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: monitor_server_api-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for monitor_server_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a116786d7412840c02b3d736ea0118d026dad03eac58a41e6e8015cfe5657426
MD5 e66671d188482a3fed0049cf333ed259
BLAKE2b-256 74fab844c2959e0cd749dd432129579d875deec0b5727a49f730fb0536b99848

See more details on using hashes here.

Supported by

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