aboutsummaryrefslogtreecommitdiff
path: root/qolab/tsdb
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-26 18:24:05 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-26 18:24:05 -0500
commit7e6e17758c9f903e5a7abd401b74a6ab13b1113f (patch)
tree710204724418eddd3e1e9fc37b300fa2c37b7b45 /qolab/tsdb
parent199d8ba5860aa231d5ac0f1647ea3f69b751ed8c (diff)
downloadqolab-7e6e17758c9f903e5a7abd401b74a6ab13b1113f.tar.gz
qolab-7e6e17758c9f903e5a7abd401b74a6ab13b1113f.zip
cleaned up tsdb
Diffstat (limited to 'qolab/tsdb')
-rw-r--r--qolab/tsdb/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/qolab/tsdb/__init__.py b/qolab/tsdb/__init__.py
index a985534..ff73832 100644
--- a/qolab/tsdb/__init__.py
+++ b/qolab/tsdb/__init__.py
@@ -1,14 +1,19 @@
import logging
import universal_tsdb as utsdb
+from universal_tsdb import Client, MaxErrorsException
import functools
import time
+__all__ = [
+ 'Client', 'Ingester', 'MaxErrorsException'
+]
+
logging.basicConfig(format='%(asctime)s %(levelname)8s %(name)s: %(message)s', datefmt='%m/%d/%Y %H:%M:%S')
logger = logging.getLogger('qolab.tsdb')
logger.setLevel(logging.INFO)
class Ingester(utsdb.Ingester):
- """ Same as universal_tsdb.Ingester byt set measurement_prefix.
+ """ Same as universal_tsdb.Ingester but sets measurement_prefix.
so measurement becomes measurement_prefix.measurement """
def __init__(self, client, batch=0, measurement_prefix=''):
super().__init__(client, batch=batch)
@@ -67,7 +72,7 @@ def tsdb_append_metric_for_class_setter_or_getter(tsdb_logger=None):
if __name__ == '__main__':
from qolab.hardware.basic import BasicInstrument
- tsdb_client = utsdb.Client('influx', 'http://localhost:8428', database='qolab')
+ tsdb_client = Client('influx', 'http://localhost:8428', database='qolab')
tsdb_ingester = Ingester(tsdb_client, batch=10, measurement_prefix='experiment.title')
class InstWithLog(BasicInstrument):
def __init__(self, *args, **kwds):