[collectd] lua plugin

Schmurfy schmurfy at gmail.com
Mon Nov 29 10:59:38 CET 2010


I pushed my changes, since you did not anything yet on notification you may
be able to use my C to lua conversion code for them, you can drop the rest.
I will let you finish the plugin.
What annoys me the most is that I spent some hours on it yesterday for
nothing, I would have worked on completing the zeromq plugin if I knew :(

As for the complexity on callbacks I really think we gain much more having a
simpler plugin code especially if it does not affect the functionalities
much (is the multiple callbacks model really used on the other languages
bindings ?), it makes it easier for newcomers to dive into the code. Since I
started working on collectd plugins not too far away I can assure you that
diving into the code is not that easy especially when you try to understand
what the hell is happening with your read/write and you end up in
filter_chain.c ;)

I will have a closer look at filters to see if I can do something for them.

Julien Ammous

On 28 November 2010 17:38, Florian Forster <octo at collectd.org> wrote:

> Hi again ;)
>
> On Sun, Nov 28, 2010 at 04:30:10PM +0100, Schmurfy wrote:
> > … callbacks …
> > do you really think the added complexity of the C code is really worth
> > what it brings to the lua side ?
>
> Just to make sure I understand your approach correctly: After the script
> is loaded, check if there is a global function called, for example,
> "cb_read". If there is, call it every $interval seconds. The script does
> not call any register_* function for this to happen – defining the
> function with this special name is sufficient.
>
> I think providing the register_* functions is worth the trouble: It is
> closer to the C API and the interfaces provided by the Perl and Python
> plugins. The Java API is a bit special because Java doesn't provide
> function pointers, but you can still register objects implementing a
> special interface.
>
> > I am more than disappointed by the way you took over my plugin
>
> Oh, sorry about that :/ I didn't mean to "steal" your plugin, I just got
> excited and carried away. When I get excited about something I usually
> start hacking away in a frenzy, sorry … I'll hold myself back.
>
> > I am not angry at you (and I hope you won't be at me for being so direct)
>
> No offense taken.
>
> > I finally managed to compile a working lua plugin on my system the
> > only problem I had is that the pkg-config package is called "lua" for
> > me with 5.1 as its version
>
> Oh $deity! The pkg-config names are the one thing that should be
> constant over all platforms … Oh well, I'll see if I can work around
> that.
>
> Best regards,
> —octo
> --
> Florian octo Forster
> Hacker in training
> GnuPG: 0x0C705A15
> http://octo.it/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iQIcBAEBAgAGBQJM8oWWAAoJEMPSHpbi2MmgbnwP/0klVhqPqIfGyBSakIcglLU9
> avHlq8bpntoAv/qErFg4H0rNC/mntHbDc/zNwrG+gLSV3xpLMm9UdsPssFSUKT6H
> Fm84w7eeRBoIBgr92O8CNmRWpvSQEnqVq+kYqRX39vIvWY1GUo7NvkQBJXO9AT5Z
> TeeztZRgCmtlnouNdcRl7A7+4nbQiYmc/vKi6HtoiWVMBw902w1RP+eAAaLH0d5B
> dPVME+Q+XqMudZoHniX1m4RLLJvNKSBV2Ij7ociYO9oGsJqcWJcp+P+mIPwX7IQp
> RGFB7dH14QJhwcytcR18aP0D7INrIM9Yp3SUMriR1ZhxJE62tTz50xwpZ2QJ7auR
> V0z/SXPMYPJDuXFekxIQ4eNzWaTZC/W/ZUS+Gtf43rOL3tdU0LXzENCoq/rEnbgN
> Oj7PqvvJHcIegrbF+mPsM1VXTesvqx1PqGohZ3j7heC7nQ1xjOcGCn6S5+xypzCl
> 5ssm9JDGRL9e4DbTD1xVnzSfuLYUYEVmsjh71KWI2NwnqS3BVj3YJIgUR5e5q0Zy
> zjOQiDOSlJo7ex/eo28GpH27jKxlU2wNfJBbrTkkSVTn5LIxQAG9vfZlp/7ImRgC
> 2+kYl0AxZfX5RG9+DynDWQWS8KsJxH9a350I9RgNcY2LDKQ+E1vWEEU7GLn1MEiA
> pVo7w1Lfsy34umBlupLt
> =A17V
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20101129/5873c751/attachment-0001.htm>


More information about the collectd mailing list