datalogd.plugins.heartbeat_datasource module¶
- class datalogd.plugins.heartbeat_datasource.HeartbeatDataSource(sinks=[], interval=1.0, counter=True, message={'id': 'heartbeat', 'type': 'config'})[source]¶
Bases:
DataSourceGenerate a regular heartbeat message for failsafe or keep-alive type purposes.
A basic message will be generated at regular intervals (default 1.0 second), controlled by the
intervalparameter. By default an integer counter will be appended to the message as thevaluefield. The initial value for the counter can be set using thecounterparamter, or setcounter=Falseto disable.The message can be set with the
messageparameter. To use the counter functionality, the message should be of a dictionary type.- Parameters:
interval – Time interval between heartbeat messages, in seconds.
counter – Append an integer counter to the message data.
message – Message to use as the heartbeat data.