Allow force write
gasagna opened this issue · 3 comments
Proposal:
Add a function to force writing data to InfluxDB even if the batch is not complete.
Current behavior:
Points are written only when the batch is complete.
Desired behavior:
A function that forces a write to the InfluxDB database.
Alternatives considered:
None.
Use case:
I have an IoT application where i'd like to write to my influxdb database once every ten points (using the batch feature) OR every minute, whichever comes first. The first scenario occurs when many nodes send data to my gateway and the batch feature enables writing this data efficiently to the database (instead of connecting for every datapoint). The second scenario is a low data rate case, where only few nodes talk, but I want this data to reach the InfluxDB database within a given time. I'd like to have a function, for instance named forceWrite()
or similar that I can call every, e.g., 60 seconds to write whatever data I have to the database.
Thanks.
I am happy to prepare a PR if this is something that would be useful to have.
@gasagna, that's what InfluxDBClient::flushBuffer() is for. Doesn't it work for you?
Apologies! did not see it.