[collectd] Generalized ignorelist functionality

Florian Forster octo at verplant.org
Tue Nov 14 09:02:44 CET 2006


Hi Lubos,

On Mon, Nov 13, 2006 at 05:52:35PM +0100, Lubo?? Stan??k wrote:
> I took your remarks and draft and created the "ignore" feature, with
> minor changes though. It handles all required tasks and adds POSIX
> regular expressions.
> The code is attached to the message.

thanks, I'll look into it as soon as possible :)

> and for the regex version:
> 	Sensor |.*\/temperature-.*3|
> 	Sensor |.*\/fanspeed-.*3|
> 	Sensor |.*\/voltage-.*3|
> 
> The primary reason for such test was to have some information about
> regex code efficiency.

Did you test with the above regexes? Because having two `.*' in there
will result in a lot of backtracking. The leading `.*' is uneffective,
so removing it will speed up the regex (unless the regex compiler is
more intelligent than I think it is ;) and not change the results. I
think a much faster variant of the above regexes would be:
  Sensor \/(temperature|fanspeed|voltage)-[a-zA-Z]3

Also, what are the pipe-signs `|' doing there? Are they the delimiters?
That'd be bad, since the pipe is the `or' in regexes and is used a lot.
Is a delimiter really necessary? And if so, slashes `/' would be a more
common choice.

> The result is: It can be used both as a replacement and a combination
> with ordinary string compare.

Yes, if used right regexes are _very_ fast :)

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20061114/b96d4e06/attachment.pgp


More information about the collectd mailing list