New Python client library for OpenTSDB

821 views
Skip to first unread message

Samuel Marks

unread,
May 6, 2014, 4:22:59 AM5/6/14
to open...@googlegroups.com
Dear OpenTSDB list,

I helped a friend out with his open-source Python client library for OpenTSDB: https://github.com/orionvm/potsdb

Might be a good addition for this page: http://opentsdb.net/docs/build/html/resources.html#clients

Best,

Samuel Marks
http://linkedin.com/in/samuelmarks

orange200

unread,
Mar 24, 2015, 1:16:34 PM3/24/15
to open...@googlegroups.com
Hi Samuel, 

I using this library for inserting data into opentsdb using the code below. 

The numbers are being rounded down to the nearest whole number. 

For example "0.156166998446" is rounded to 0 and 10.5 is rounded to 10.

Would you why this is happening and how to resolve it? 

Thanks


import potsdb

def opentsdb_upload_offset(device, sensor, offset_correction):
    metrics = potsdb.Client('example.com', port=4242, qsize=1000, host_tag=True, mps=100, check_host=True)
    print 'offset correction is'
    print offset_correction
    metrics.send('offset_correction', offset_correction, sensor_id = sensor, sender_id = device)
    metrics.wait()
    print("Successfully loaded offset correction for %s, offset correction is %s  " % (sensor, offset_correction))
    

if __name__ == "__main__": 
    device = 'test_device'
    sensor = 'test_sensor'
    offset_correction = 0.156166998446

    opentsdb_upload_offset(device, sensor, offset_correction)

ManOLamancha

unread,
Mar 31, 2015, 6:34:39 PM3/31/15
to open...@googlegroups.com
On Tuesday, March 24, 2015 at 10:16:34 AM UTC-7, orange200 wrote:
Hi Samuel, 

I using this library for inserting data into opentsdb using the code below. 

The numbers are being rounded down to the nearest whole number. 

For example "0.156166998446" is rounded to 0 and 10.5 is rounded to 10.

Would you why this is happening and how to resolve it?

I'll also add the link to the docs. Thanks!
Reply all
Reply to author
Forward
0 new messages