[collectd] curl_xml plugin

Florian Forster octo at verplant.org
Mon Jan 11 16:56:21 CET 2010


Hi Amit,

thank you very much for your patch :)

I've applied the patch to my working directory and submitted it (and
some changes of my own) to the “ag/curl_xml” branch of the Git
repository. If you don't want to use Git you can download the latest
version of src/curl_xml.c from [0].

I did the following changes:

 * Re-order all of the functions to get rid of the forward declarations.
 * Replace the string and boolean handling functions for config options
   with functions declared in src/configfile.h. This way the
   functionality is not duplicated.
 * Put the type_instance setting and value parsing into a separate
   functions. This makes “cx_submit_xpath_values” considerably bit
   shorter.

Please let me know if my changes broke anything – unfortunately I didn't
have the possibility to test them :/

> #define CX_KEY_MAGIC 0x43484b59UL /* CHKY */
> #define CX_IS_KEY(key) (key)->magic == CX_KEY_MAGIC

What do we need this hack for? I've found only one place where
“c_avl_insert” is called, so the elements in the tree should all be of
the same type, right? I'd be great if you could remove or document this.

Maybe the entire AVL tree should be removed: As far as I see it is only
used to iterate over the values (rather than searching for a specific
key), so a linked list is probably more appropriate.

Both, “cx_check_type” and “cx_submit_xpath_values” call “plugin_get_ds”.
I think one call could be optimized away.

Best regards,
—octo

[0] <http://git.verplant.org/?p=collectd.git;a=blob_plain;f=src/curl_xml.c;hb=refs/heads/ag/curl_xml>
-- 
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/20100111/ba12bdef/attachment.pgp 


More information about the collectd mailing list