Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

WhoopInc/pytsdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytsdb

Featureless Python adapter for OpenTSDB

Installation

pip3 install git+ssh://git@github.com/WhoopInc/pytsdb@v0.2.1

Usage

import datetime
import pytsdb

con = pytsdb.connect("hostname.example.com")
con.fetch_metric(metric="host0.cpu",
    start=datetime.datetime(2014, 1, 27),
    tags={ 'user_id': 44 },
    end=datetime.datetime(2014, 1, 29))
>>> { '1390955680': 66.0, '1390955681': 63.0 }

Handling errors

try:
    con.fetch_metric(...)
except pytsdb.TimeoutError:
    print("Is TSDB running?!")

Release

Skip this section unless you're hacking on pytsdb!

To cut a new release, bump the version number in setup.py and in the README installation instructions. Then:

git add -A
git commit
git tag -a "vx.x.x"
git push --follow-tags