[collectd] Averaging Samples when SigRok provides higher resolution

Kieran Bingham kieranbingham at gmail.com
Wed Sep 25 16:22:33 CEST 2013


Hi Guys,

We are using CollectD to record power consumption readings from a
digital multimeter through Sigrok.

The Multimeter has an update rate of 5Hz, but we are storing the data as RRD,
which appears to be limited as 1Hz by its data storage format.

We can overcome this easily by setting the MinimumInterval as shown below:

<Plugin sigrok>
  LogLevel 3
  <Device "inlet_current">
    Driver "agilent-dmm"
    MinimumInterval 1
    Conn "/dev/ttyUSB0"
  </Device>
</Plugin>

However this means that we are losing resolution from our readings, as
we are only storing a single sampling point out of 5.

To enhance the data for our graphs, it was suggested to store the average
of all of the readings per dispatch

For example, I have implemented a patch to do this at :
  https://github.com/kbingham/collectd/commit/47acd32d7a83538b74ec4d186af4891404f6ec08

Is this something that is worth adding ?
What are peoples initial thoughts, reviews, and reactions?

Is there a better way to do this more generically across the code base?
Perhaps for example - I should move the average functions to a util_avg.c

Or of course - is there already something generic in the code base to do this ?
(I'm still new to this code base!)

I think this may be useful to others - but should probably be configurable so
I'll look at putting the change under a configuration option next.

I just thought it was worth posting early :D

Regards

Kieran



More information about the collectd mailing list