in src/streamHandlers.py [0:0]
def createPoints(self, jsonString):
"""
Helper function to create an array of InfluxDB Points to publish to InfluxDB
Parameters
----------
jsonString(dict): The telemetry event JSON
Returns
-------
influxdb_client.Point
"""
points = []
for metric in jsonString:
# Must convert to UTC for InfluxDB
p = influxdb_client.Point(metric["N"]).tag("NS", metric["NS"]) \
.tag("U", metric["U"]) \
.tag("A", metric["A"]) \
.field("V", metric["V"]) \
.time(datetime.fromtimestamp(metric["TS"]/1000.0, tz=timezone.utc))
points.append(p)
return points