README
A python library to send application metrics using UDP.
Installation
pip install measures
Usage
count
from measures import Measure
measure = Measure('myclient', ('localhost', 1984))
measure.count('mymetric', dimensions={'name': 'john'})
time (measure time spent on a given block)
import time
from measures import Measure
measure = Measure('myclient', ('localhost', 1984))
with measure.time('mymetric'):
# do some slow operation:
time.sleep(3.14159)
import time
from measures import Measure
measure = Measure('myclient', ('localhost', 1984))
with measure.time('mymetric') as dimensions:
# do some slow operation:
time.sleep(1.61803)
# add any relevant information, if necessary:
dimensions['relevant_info'] = 'pertinent_info'
send
from measures import Measure
measure = Measure('myclient', ('localhost', 1984))
dimensions = {
'time': 10.1,
'relevant_info': pertinent_info
}
measure.send('mymetric', dimensions)
multiple destinations
Metrics can be sent to more than one backend
from measures import Measure
measure = Measure('myclient', [('backend.host.1', 1984), ('backend.host.2', 1984)]
Contributing
Set up your environment
git clone https://github.com/globocom/measures.git
cd measures
mkvirtualenv measures
pip install -r test_requirements.txt
Run the tests
make tests
Write tests for your new feature or bug fix
Write needed code changes
Iterate, have fun :)
Make a pull request with your changes
Who do I talk to?
File an issue at https://github.com/globocom/measures or contact us at busca@corp.globo.com
Metadata
Release files for measures 1.4.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 |
|---|---|---|---|---|
| measures-1.4.0.tar.gz | 2.4 kB | Without provenance | Details for measures-1.4.0.tar.gz |
Release files / measures-1.4.0.tar.gz
| Download URL | measures-1.4.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47d08c594f53152ace309181648a910436df81d95c2a107e878c28b7bee20786
|
|
BLAKE2b-256 checksum How to use checksums |
347a72dac212602b2d68d87bfe3d381ef6cdeb7c99cac5b5e3ccea034d8eebd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for measures 1.4.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.