[collectd] Tail plugin and DSType gauge

Toni Ylenius toniylenius at gmail.com
Sun Sep 4 09:38:04 CEST 2011


Hi Florian,

On Saturday 03 September 2011 05:43:48 Florian Forster wrote:
> Hi Toni,
> 
> On Fri, Sep 02, 2011 at 04:20:17PM +0300, Toni Ylenius wrote:
> > I found out that a value is reset to Nan in the function
> > simple_submit_match (src/utils_tail_match.c) on each submit. I don't
> > understand why is this, to me it makes more sense to retain the old
> > value until the file is updated.
> 
> I think there are two interesting cases:
> 0) Several matches are found in the last x lines.
> 1) No matches are found in those lines.
> 
> How (0) is handled should be clear, I hope: In your case the minimum is
> computed and submitted.

That is true, but I can hardly imagine an application that writes some status 
information to a file many times within a short interval. However this may be 
useful, if plugins' intervals could be set individually.
 
> For (1) it is a bit tricky to define a good behavior: If you'd gather
> the average request size, for example, no requests means no average
> size, hence NaN (and not zero). In your case keeping the old value
> "valid" until another value has been matched might be preferable.
> 
> I've whipped together a patch which implements this behavior. You can
> take a look at [0]. It's missing documentation and the new functionality
> should be ported to the "curl" and "memcachec" plugins -- preferably the
> configuration part would be de-duplicated in the process.
>
> Regards,
> —octo
> 
> [0] <https://collectd.org/gerrit/18>

Thanks for your effort, the patch seems to work fine.

Toni



More information about the collectd mailing list