Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Influxdb: fix sensor send frequency, use async client, send data in batches #2061

Merged
merged 2 commits into from
Dec 16, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Dec 14, 2019

fix #2044

  • use separate Broker instances for sensor read and report
  • use async client directly
  • send multiple measurements in a single request
  • quote string measurements

Avoiding SyncClient for now, since there is no clear benefit of using it over WiFiClient. Move to async client directly (possibly this will be a base for generic client object). For helper object to work it needs to:

  • have easily accessible buffer data structure for direct writes. control allocation, maybe allow persistent structures instead of creating / destroying everything each connection.
  • allow writes to happen asynchronously, we don't need to block everything if for N seconds.
    probably via a separate method, to keep existing Client interface
  • rx buffer should be configurable
    Also keeping in mind possible migration to basic sockets.

using SensorBroker = TBroker<TBrokerType::SENSOR, const String&, unsigned char, double, const char*>;

using SensorReadBroker = TBroker<TBrokerType::SENSOR_READ, const String&, unsigned char, double, const char*>;
using SensorReportBroker = TBroker<TBrokerType::SENSOR_REPORT, const String&, unsigned char, double, const char*>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note to the reader:
The very first arg is needed to distinguish between two otherwise identical templates, without it both ReadBroker and ReportBroker would be the exact same class.

@mcspr mcspr merged commit 0ae6e3b into xoseperez:dev Dec 16, 2019
@mcspr mcspr deleted the idb/async-client branch December 16, 2019 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BROKER_REAL_TIME=1 causes crashes in the INFLUXDB module
1 participant