processes plugin: Fix counters initialization / spikes
authorPavel Rochnyack <pavel2000@ngs.ru>
Mon, 10 Oct 2016 07:25:07 +0000 (13:25 +0600)
committerPavel Rochnyack <pavel2000@ngs.ru>
Mon, 10 Oct 2016 07:25:07 +0000 (13:25 +0600)
commitbb0000acfc57e230fc1c26099bc7acb913680f1a
tree595f9b8b448d56b3d3b0dd35896c094f59b3e40e
parent14b4024e2e621b440f96e8f2ef1af04d6275ee34
processes plugin: Fix counters initialization / spikes

processes plugin generates spikes on (re)start. That is caused by
wrong counter logic: When collectd (re)started, monitored processes,
which was started before collectd, have non-zero values in
cpu_user/cpu_system/vmem_minflt/vmem_majflt, so `want_init` is false.
What produces spike.
At other hand, processes which are started between read cycles, should
be fully accounted without initialization. So, we must skip only first
cycle for these counters.
src/processes.c