0

Collectd has different data source types like Gauge, Derive, Counter and Absolute.

Lets take derive data source type. It basically gives rate of change. i.e (new_value - old_value ) / (new_time - old_time). All I am interested is only in the numerator part. I want to know the (new_value - old_value) without having the time factor in the denominator. IS there anyway I can achieve this through collectd?

Thanks

1 Answers1

0

It might be helpful to describe in more detail what you're trying to achieve with a real example. It may be that you're misunderstanding something in rrdtool. I don't quite understand what you would like to see in terms of graph (I assume in the end you are trying to graph the data using rrdtool graph).

As far as I know you can't do what you intend directly. Two options i can come up with:

  1. Use fake time, e.g., insert the first data point with time 1, second with time 2, etc. Then derive will yield what you want, but of course you won't get timestamps
  2. Insert the data points as a gauge and then use RPN to produce a graph to your liking. I believe that if you use the PREV operator you can basically "remember" the previous data point and use that to do the difference calculation. It would be a bit involved and probably fragile, though. See http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html for details on the RPN stuff. If you get stuck with this comment on this answer and I'll try to help further.
TvE
  • 131
  • 3