feeder: use FrappyManager to connect to running frappy instances
This commit is contained in:
@ -175,7 +175,8 @@ class SEHistory(InfluxDBWrapper):
|
||||
def add_error(self, value, key, tags, ts):
|
||||
self._add_point('.'.join(key), 'error', '' if value is None else str(value), ts, tags)
|
||||
|
||||
def get_streams(self, instrument=None, stream=None, device=None, start=None, end=None, **tags):
|
||||
def get_streams(self, instrument=None, stream=None, device=None,
|
||||
start=None, end=None, include_finished=False, **tags):
|
||||
"""get streams for one or all instruments
|
||||
|
||||
:param instrument: None when looking for all instruments
|
||||
@ -183,6 +184,7 @@ class SEHistory(InfluxDBWrapper):
|
||||
:param device: None or a comma separated string
|
||||
:param start: None or start time. None means 'since ever'
|
||||
:param end: None or end time. None means now (or more precise 'in a year')
|
||||
:param include_finished: whether finished streams are to be included (False by default)
|
||||
:return: dict <stream> of tags
|
||||
|
||||
Remark: an assignment of an instrument to a stream persists, even when the stream gets off
|
||||
@ -232,7 +234,7 @@ class SEHistory(InfluxDBWrapper):
|
||||
if ts < current[0] + 60:
|
||||
# probably not containing real data
|
||||
current = None
|
||||
if current:
|
||||
if current or include_finished:
|
||||
tags = current[1]
|
||||
ins = tags.get('instrument')
|
||||
if ins == '0':
|
||||
@ -280,7 +282,6 @@ class SEHistory(InfluxDBWrapper):
|
||||
stream, instrument, device = [table.tags.get(k, '') for k in ('stream', 'instrument', 'device')]
|
||||
elist = by_stream.setdefault(stream, [])
|
||||
for row in table:
|
||||
print('S', stream, instrument, device, row[1], fmtime(row[0]))
|
||||
elist.append([row[0], row[1], stream, device, instrument])
|
||||
by_key = {}
|
||||
for stream, rows in by_stream.items():
|
||||
|
Reference in New Issue
Block a user