[collectd] lua plugin
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
I will have a closer look at filters to see if I can do something for them.
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
> Best regards,
> Florian octo Forster
> Hacker in training
> GnuPG: 0x0C705A15
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> -----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the collectd