[collectd] curl_xml plugin

Amit Gupta amit.gupta221 at gmail.com
Wed Jan 13 12:01:37 CET 2010


On Mon, Jan 11, 2010 at 9:26 PM, Florian Forster <octo at verplant.org> wrote:

> Hi Amit,
>
> thank you very much for your patch :)
>

Thanks for applying the patch :)


> 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 :/
>

I did a sanity testing and the plugin seems to be working fine.


> > #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.
>

There is no need of  this magic key. It just happens to be there since I
borrowed the code from curl_json :). I will clean this up.

>
> 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.
>

Yeah I agree. I have replaced avl tree with a linked list.

>
> Both, “cx_check_type” and “cx_submit_xpath_values” call “plugin_get_ds”.
> I think one call could be optimized away.
>
This is also done.

Do find the updated patch attached.

Regards
Amit

>
> 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/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFLS0olHdggu3Q05IYRAuMXAJ440LTtkMUZaDb7MUq4EdnXw8SXTgCfS3gS
> Pat48nthKsGvE3YMI6rIOh0=
> =VgpJ
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20100113/56b9f3ee/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: curl_xml.patch
Type: text/x-patch
Size: 9763 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100113/56b9f3ee/attachment.bin 


More information about the collectd mailing list