def setUp(self): global rts rts = RedisTimeSeries(port=port) rts.flushdb()
# An example Python client for Redis key-value store using RedisTimeSeries. from redistimeseries.client import Client as RedisTimeSeries import time import sys import site import datetime import random print(' \n '.join(sys.path)) ts = RedisTimeSeries(host='localhost', port=6379) ts.flushdb() key = 'temperature' def create(key): print('\n Create new time series: %s' % str(key)) #ts.create(key,retentionSecs=30,labels={'sensor_id' : 2,'area_id' : 32}) ts.create(key, retention_msecs=30000, labels={ 'sensor_id': 2, 'area_id': 32 }) print('')