Hi
I am trying to use InfluxDB to save samples from accelerometer with frequency of 1,6 kHz.
I am using influxdb:latest inside docker container.
my samples litst looks like this:
{'time': '2025-02-18T15:34:24.750512Z', 'value': 1041},
{'time': '2025-02-18T15:34:24.750858Z', 'value': 1043},
I am getting time and value with this:
time = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ')
sample = { "time": time, "value": self.value}
self.samples.append(sample)
Then I send samples in a batch of about 1670 samples
# Called periodically, once per second
points = []
for sample in self.samples:
point = Point("data").field("Linear acceleration", sample["value"]).time(sample["time"])
points.append(point)
write_api.write(bucket=bucket, org=org, record=points)
self.samples.clear()
Then in InfluxDB web interface I see only single point per second and _time is rounded to single seconds:
Why am I losing samples?