ocredis
ocredis is a wrapper for the popular [redis-py](https://github.com/andymccurdy/redis-py)
ocredis provides observability using OpenCensus for distributed tracing and metrics.
Installing it
pip install ocredis
Using it
You can initialize exactly how you would for redis.Redis. In fact it is meant to be a drop replacement.
Change the import statement from
>>> import redis
to
>>> import ocredis
Change the client initialization from
>>> client = redis.Redis(host=host, port=port)
to
>>> client = ocredis.OcRedis(host=host, port=port)`
and obviously enabling OpenCensus metrics and exporters as per https://opencensus.io/exporters/supported-exporters/python/
>>> ocredis.register_views()
and the rest is trivial to use then.
For example
>>> import ocredis
>>> ocredis.register_views()
>>> r = ocredis.OcRedis(host='localhost', port=6379)
>>> r.set('foo', 'bar')
True
>>> r.get('foo')
'bar'
Metrics available
calls
latency
key_length
value_length
Metric |
View Name |
Unit |
Tags |
|---|---|---|---|
Latency |
redispy/latency |
ms |
‘error’, ‘method’, ‘status’ |
Calls |
redispy/calls |
1 |
‘error’, ‘method’, ‘status’ |
Key lengths |
redispy/key_length |
By |
‘error’, ‘method’, ‘status’ |
Value lengths |
redispy/value_length |
By |
‘error’, ‘method’, ‘status’ |
Tests
Tests can be run by using pytest, for example
pytest
Metadata
Release files for ocredis 0.0.4
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 |
|---|---|---|---|---|
| ocredis-0.0.4.tar.gz | 12.7 kB | Without provenance | Details for ocredis-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ocredis-0.0.4-py2-none-any.whl | Python 2 | none | any | Details for ocredis-0.0.4-py2-none-any.whl |
Total release size: 27.0 kB
Release files / ocredis-0.0.4.tar.gz
| Download URL | ocredis-0.0.4.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fdcc8ca1b8c915abe5f270e0b7574d2d2ab1f9d545c9882b9bbde162b3828f1
|
|
BLAKE2b-256 checksum How to use checksums |
06b964a9507d323902dcfdfad57407f22c0883d6b5ae4c772f40ffe2121ca667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15
|
Release files / ocredis-0.0.4-py2-none-any.whl
| Download URL | ocredis-0.0.4-py2-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
7b1e90309120a831b6c6c49405ca08dcf2fdbae2338510d65e6a9e12e4b92d3b
|
|
BLAKE2b-256 checksum How to use checksums |
1211266c43988ddb569f277d1c6c8e905b277ab026c038d3a8f19e13bd1a353c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15
|
Security for ocredis 0.0.4
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.