Collectd-style statistics in C