async_metrics
asyncio metrics for your app.
Available metrics:
- asyncio: event loop status, policy and exception handler and tasks info;
- system: uptime, platform, recursion limit, default encoding, phisical and virtual processors, system load and process user;
- dependencies: application dependencies;
- python: implementation, version and PATH;
- process: application process info like: threads, open files, connections, context switch and childrens PID;
- partitions: partitions usage;
- about: async_metrics version, project: url, issues and release pages.
Installation
Install and update using pip:
pip install -U async_metrics
Usage
AIOHTTP
from aiohttp import web
from async_metrics.ext.aiohttp import setup_async_metrics
app = web.Application()
setup_async_metrics(app)
web.run_app(app, host="0.0.0.0")
Flask
from flask import Flask
from async_metrics.ext.flask import setup_async_metrics
app = Flask(__name__)
setup_async_metrics(app)
@app.route('/')
def hello_world():
return 'Hello, World!'
Examples
Clone the repository, install the dependencies and follow the following steps:
AIOHTTP
python examples/aiohttp_example.py
For web UI dashboard access:
- http://localhost:8080/async_metrics/dashboard
Flask
FLASK_APP=examples/flask_example.py flask run
For web UI dashboard access:
- http://localhost:5000/async_metrics/dashboard
CLI
Installation
pip install async_metrics[cli]
Usage
python -m async_metrics show -h
Usage: python -m async_metrics show [OPTIONS] [ADDRESS]
Options:
--asyncio Show summary information about async environmen.
--system Show information about system environment.
--deps Show applications dependencies.
--python Show information about current python environment.
--process Show summary information about application process.
--partitions Show summary information about disk partition.
--about Show information about async_metrics.
-h, --help Show this message and exit.
ADDRESS can be set via environment variable
ASYNC_METRICS_HOST
Acessing AIOHTTP example metrics:
# default request URL: http://localhost:8080/async_metrics
python -m async_metrics show --system
Acessing Flask example metrics:
python -m async_metrics show http://localhost:5000/async_metrics --system
Links
- License: Apache License
- Code: https://github.com/amenezes/async_metrics
- Issue tracker: https://github.com/amenezes/async_metrics/issues
- Docs: https://github.com/amenezes/async_metrics
Metadata
Release files for async-metrics 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| async_metrics-0.1.0.tar.gz | 17.4 kB | Without provenance | Details for async_metrics-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| async_metrics-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for async_metrics-0.1.0-py2.py3-none-any.whl |
Total release size: 36.5 kB
Release files / async_metrics-0.1.0.tar.gz
| Download URL | async_metrics-0.1.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32e422dbdce291cae518790cf8b8f183ecbc6d3a20877adc143369014e61d02e
|
|
BLAKE2b-256 checksum How to use checksums |
d783f91069573f8139a3d1141737b94e00d104d64074debc9f603d4727344e1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / async_metrics-0.1.0-py2.py3-none-any.whl
| Download URL | async_metrics-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f904fe4cbffd07f95e97500d271a93d822334ae4c8ddee09c060ae522cb82c91
|
|
BLAKE2b-256 checksum How to use checksums |
c783a0c557ad2317400f035c03d29f1f0dd33b38512d90bc74a82c3d0339f11d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for async-metrics 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.