collectd-diskstats icon indicating copy to clipboard operation
collectd-diskstats copied to clipboard

Use "counter" type of value instead of gauge.

Open PierreF opened this issue 10 years ago • 2 comments

Isn't more adapted to use "counter" type of value and let collectd compute the delta between value ?

It simplify the code and also make metric being "per second".

With old code, metric are "number of writes since last measurement" (which is usually 10 seconds). When using counter, collectd compute the delta for us and make the metric per second.

What do you think of this change ?

PierreF avatar Jul 21 '15 11:07 PierreF

It's been a while since I wrote this, but I remember trying to use counter originally and something wonky happened. Maybe I was just too impatient to have to use derivatives everywhere in Graphite in order to produce usable graphs.

Like it or not, users of this code expect the current behavior. This change is backwards incompatible and too invasive. If you refactor this to make it a configurable option, I'll accept the pull request. But the current behavior needs to be retained as the default behavior.

indygreg avatar Aug 29 '15 22:08 indygreg

I've updated the pull request to include a 'DeltaPerSecond' configuration parameter.

It defaults to 'no' : old behavior.

Their is only one little change in old behavior : io_inprogress is always sent, including the very first time. It means that unlike before, when collectd start io_inprogress will be sent immediately and alone. It break the assumption that all metrics are always sent together. I could fix this, but I think it minor enough and it reduces the number of if-then-else.

PierreF avatar Aug 31 '15 09:08 PierreF