I want to record data every 10 milliseconds. Here is the sample code:
with InfluxDBClient(url=url, token=token, org=org, enable_gzip=True) as client:
with client.write_api(
write_options=WriteOptions(
batch_size=100, flush_interval=500, jitter_interval=0
)
) as write_client:
while True:
time.sleep(0.01)
val = np.random.randint(10)
print(val)
write_client.write(
bucket,
org,
{
"measurement": "my_measurement",
"fields": {"my_value": int(val)},
},
)
write_client.flush()
However, the above does not record with a required frequency. Also, it is confusing for me how the batching will be handled in this case.