[collectd] collectd for embedded, time tag

Florian Forster octo at collectd.org
Thu Apr 23 13:33:40 CEST 2020


Hi Denys,

On 2020-04-23 12:14, Denys Fedoryshchenko wrote:
> I can try to write patch, for example:

that'd great!

> Extending sockent_t by adding there uint8_t (or int) "options" 
> parameter,
> where certain optional bits can be set.
> So, for example bit 0 will be "ZERO_AS_CURRENT_TIME"
> 
> Then, maybe, it can be set in config as optional, third parameter for
> "Listen" socket.
> Like:
> Listen "ff18::efc0:4a42" "ZeroAsCurrentTime"

I think this should be a named ("child") parameter, instead of a 
positional ("value") parameter. The configuration could look like this:

   <Listen "ff18::efc0:4a42" "25826">
     ZeroAsCurrentTime true
   </Listen>

To implement this, I'd extend `struct sockent_server` to add a boolean, 
e.g.:

   struct sockent_server {
     // …
     _Bool accept_zero_time;
   }

This is more readable than using flags / a bitfield.

Populate this field in `network_config_add_listen()`. The helper 
function `cf_util_get_boolean()` (from "configfile.h") is probably 
useful here.

Then, in `parse_packet()`, pass the boolean on to 
`network_dispatch_values()`.

Last step would be to document the new config option in 
src/collectd.conf.pod (source of the manpage) and src/collectd.conf.in 
(default config).

HTH; if you have any questions or run into issues, feel free to ask :)
Best regards,
—octo
-- 
collectd – The system statistics collection daemon
Website: http://collectd.org
GitHub:  https://github.com/collectd
Twitter: http://twitter.com/collectd



More information about the collectd mailing list