[collectd] StoreRates option for Network plugin

Edson Marquezani Filho edsonmarquezani at gmail.com
Fri Apr 25 23:50:08 CEST 2014

Well, I've managed to do that myself (in part because I'm very
impacient, in part because I wanted to have a bit of fun.)

The patch based on the latest version (5.4.1) is attached. It adds the
StoreRate option for Network (only in global scope), using the
function uc_get_rates from utils_cache.c to calculate it.

I based my modifications on the CSV plugin, trying to be as clean as I
could. The patch itself is short, so I think I was. Also tried to
follow the current code style.

I compared the values from Network and CSV output, all they seem to
generate the same values. It's working here apparently well, but I
have not tested it for a long time yet.

Be aware that I'm not a professional programmer (I'm a sysadmin) and
some things may not be perfectly correct. One attention point is that,
based on CSV plugin, I followed a rule of only calculating rates for
values which are not of GAUGE type. I don't fully understand the
reason for that, but once the data is the same for any output plugin,
I assumed it was right for Network too.

I don't know whether this patch is going to be accepted or not, but I
think I'll use it, anyway (at least until this feature is available on
upstream), and I hope it helps those who have the same need I do.


On Thu, Apr 24, 2014 at 6:26 PM, Edson Marquezani Filho
<edsonmarquezani at gmail.com> wrote:
> Hello, everyone.
> I'm new with Collectd but I'm finding it an amazing tool, very useful.
> I'm trying to put up a simple setup here with it and Logstash, to send
> metrics to an specific system we have in the company I work for.
> Everything fine so far, except that I can't obtain rate values for
> CPU. I'm using the network plugin to connect with Logstash, and it
> does not have the "StoreRates" option that all write plugins seem to
> have.
> Is that feature in the plans for a near future? (I couldn't find much
> about that on Internet, as if no one needed it like me.)
> I know that I could get around it writing to a CSV file and reading it
> from logstash but I really wouldn't like to, considering that Logstash
> has even an specific output type for Collectd.
> Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: network_store_rates.patch
Type: text/x-patch
Size: 3195 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20140425/104cf2ae/attachment.bin>

More information about the collectd mailing list