No project description provided
Project description
Muffin-Metrics – Send data to Graphite/StatsD from Muffin application.
Requirements
python >= 3.3
Installation
Muffin-Metrics should be installed using pip:
pip install muffin-metrics
Usage
Add muffin_metrics to PLUGINS in your Muffin Application configuration.
Options
METRICS_BACKENDS – Graphite backends in format ([])
METRICS_BACKENDS = ( ('udp': 'udp://address:port'), ('tcp': 'tcp://address:port'), ('statsd_udp': 'udp+statsd://address:port'), ('statsd_tcp': 'tcp+statsd://address:port'), ) METRICS_DEFAULT = 'udp'
METRICS_DEFAULT – Default backend (None)
METRICS_FAIL_SILENTLY – Don’t raise connection’s exceptions (False)
METRICS_MAXUDPSIZE – Max size of UDP message (512)
METRICS_PREFIX – Prefix for metrics (muffin.)
Usage
@app.register('/my')
def my_view(request):
# Context manager (group metrics to pipeline and send them as one message)
with (yield from app.ps.metrics.client()) as metrics:
metrics.send(42, path='answer.to.the.ultimate.question')
# ...
metrics.send(31, path='some.some')
# Send data
yield from app.ps.metrics.send(100, path='one.hungred', backend='mybackend')
# Create client and send data
metrics = yield from app.ps.metrics.client(backend='tcp')
metrics.send('twenty.four', 24)
metrics.disconnect()
# Send data to statsd
with (yield from app.ps.metrics.client(backend='statsd_tcp')) as client:
client.incr('request.method.%s' % request.method)
client.timing('response.time', timer.ms)
client.incr('response.status.%s' % response.status)
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-metrics/issues
Contributing
Development of Muffin-Metrics happens at: https://github.com/klen/muffin-metrics
Contributors
klen (Kirill Klenov)
License
Licensed under a MIT license.
Project details
Release history Release notifications | RSS feed
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 muffin-metrics-0.1.3.tar.gz
.
File metadata
- Download URL: muffin-metrics-0.1.3.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 249662f4f431dc4e17a6bbbaa7acc6d5e38f1ed3f129cd5278302a1d4d1c4e3d |
|
MD5 | ccb0e8fe929a0c8a305b7923effc35a8 |
|
BLAKE2b-256 | 29b6a86b5f572ad474d5029982a0d5bbf654a0288e71fb4dca4ffde6e1116d24 |
File details
Details for the file muffin_metrics-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: muffin_metrics-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a50937adca4fff4257eeae992114c3d46183295a04c9b635435e5e816455381 |
|
MD5 | df0a10848b8460b2263639aa278dd35e |
|
BLAKE2b-256 | d0188b926df4efc9816bc52438bca6313bd713b895ecac4763a0ed12e0bdde74 |