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 hashes)
Built Distribution
Close
Hashes for timekeeper-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64bd6080089e58a5777b0e01d4b08c27ee326edad81bed5a5e52bbf76edcb946 |
|
MD5 | 186922eaebe00b2536542ab00c406a3b |
|
BLAKE2b-256 | 62160e52239d837fa2bdec9b0e782bb94145fa869a1fcefe4a8a6a054dce8df7 |