Send runtime measurements of your code to InfluxDB
Project description
Timekeeper is a library for instrumentation of live Python code by sending measurements to InfluxDB.
Requires Python 2.7 or 3.2+, and InfluxDB 0.9.0+.
Usage
=====
```python
from timekeeper import TimeKeeper
tk = TimeKeeper(
"udp+influxdb://localhost/databasename",
prefix="location-1.cluster-1.app-1.", # if you prefer Graphite style over tags
tags={"host": "location-1.cluster-1.app-1"},
)
@tk.decorate("some_slow_function", tags={"foo": "bar"})
def slowpoke():
sleep(9001)
def slowpoke2():
with tk.context("some_other_slow_function", tags={"foo": "baz"}):
sleep(9001)
```
Installation
============
```
pip install timekeeper
```
Requires Python 2.7 or 3.2+, and InfluxDB 0.9.0+.
Usage
=====
```python
from timekeeper import TimeKeeper
tk = TimeKeeper(
"udp+influxdb://localhost/databasename",
prefix="location-1.cluster-1.app-1.", # if you prefer Graphite style over tags
tags={"host": "location-1.cluster-1.app-1"},
)
@tk.decorate("some_slow_function", tags={"foo": "bar"})
def slowpoke():
sleep(9001)
def slowpoke2():
with tk.context("some_other_slow_function", tags={"foo": "baz"}):
sleep(9001)
```
Installation
============
```
pip install timekeeper
```
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
timekeeper-0.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timekeeper-0.1.0.tar.gz.
File metadata
- Download URL: timekeeper-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ea7a38e852b1df079eed0ab02dc04306f4e8c49aed28d9457ab1f69d4e84b6
|
|
| MD5 |
3ddc50aa96dd25de28fbcce76feecd53
|
|
| BLAKE2b-256 |
9166aa7c8b420a2c4cb19f0edff3bced607efda6a1f62039c068cccf87a7087a
|
File details
Details for the file timekeeper-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: timekeeper-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64bd6080089e58a5777b0e01d4b08c27ee326edad81bed5a5e52bbf76edcb946
|
|
| MD5 |
186922eaebe00b2536542ab00c406a3b
|
|
| BLAKE2b-256 |
62160e52239d837fa2bdec9b0e782bb94145fa869a1fcefe4a8a6a054dce8df7
|