[collectd] Generalized ignorelist functionality
Florian Forster
octo at verplant.org
Sat Nov 18 14:14:54 CET 2006
Hi Lubos,
I'm in the process of looking over your code right this moment ;) I've
renamed `config_list.[ch]' to `utils_ignorelist.[ch]' because I think
that's more intuitive. This inverts the functionality to a point, so
some more small changes would make sense, to get the overall interface
more streamlined..
> > I'll see over it more thoroughly tomorrow and maybe I have some
> > points then; for now I'm hapy that is compiles cleanly :)
>
> Sure, you will. :)
And here it comes ;)
- I've inverted the argument passed to `create' and renamed it to
`invert'. If it is false, all matching entries will be ignored. If if
is true, all matching entries will be collected, everything else will
be ignored.
Come to think about it, this is the other way around as the usual
config-usage (where you have to set `IgnoreSelected' to get an
`ignorelist' functionality. What do you think, should I undo my
changes and rename it to `search list' (or some other, ``forward
matching'' name) instead?
- Is the `init' function necessary? If there was polymorphism in C I'd
welcome having a default-argument for the `create' function, but think
think having both, `init' and `create' with basically the same
functionality, is confusing.
- Why did you make the regex-stuff optional? The regex-things are in
POSIX and should therefore exist everywhere. (How well that works can
be seen in `utils_mount.c' *sigh*) Anyway, if someone only writes
`Match foobar' the regex-automaton will essentially do the same as
`strcmp'..
Also, we would not need the delimiters then, which I don't like that
much. Alternatively we could provide some `add_regex' function for
plugins to provide both, `MatchString' and `MatchRegex'.
The advantage of string-comparsion is, that it's absolutely ordered,
making is possible to use a binary search tree and increase speed. But
with only a few entries this speedup is likely neglectible.
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/20061118/daef2eb1/attachment.pgp
More information about the collectd
mailing list