[collectd] lua plugin
schmurfy at gmail.com
Fri Dec 10 11:18:21 CET 2010
so... what do you think of this ?
On 5 December 2010 18:12, Schmurfy <schmurfy at gmail.com> wrote:
> I added a form of alternative to the filters which should do the job for
> me. I added a new hooks for plugins, they can register/unregister filter
> callbacks, the way they work is dead simple:
> The callback method receives a copy of the value_list structure and is free
> to change whatever is inside (a safer version should prevent any changes to
> the length of values and values_len, currently I did the check in the lua
> So what do you think of this solution ?
> For me I can easily see it replace the curent filter system, here is a
> concrete example:
> function cb_filter(vl)
> if vl.plugin == "something"
> vl.plugin = "something_else"
> return vl
> this would rename everything from plugin "something" to come from the
> plugin "something_else".
> The code is pushed on my lua branch and is working.
> For the callbacks dilemma I still have (you did not answer my last
> questions on it ;) ), I have another option for you between yours and mine:
> Allow the lua scripts to define ONE and only one callback for each type
> (collectd_register_read would becomes collected_set_read_callback).
> Unless proved wrong I am convinced that providing more than one callback
> for each script is useless and makes the plugin code far more complex than
> it could, ever more since the language we call the function in is well able
> to handle a dispatcher easier than the C code if the user really wants it.
> Julien Ammous.
> On 5 December 2010 08:51, Florian Forster <octo at collectd.org> wrote:
>> Hi Schmurfy,
>> On Sun, Nov 28, 2010 at 04:30:10PM +0100, Schmurfy wrote:
>> > $PKG_CONFIG --exists lua5.1 2>/dev/null
>> > becomes
>> > $PKG_CONFIG --exists "lua >= 5.1" 2>/dev/null
>> I've fixed this in my "ja/lua" branch. The name used by pkg-config is
>> not determined fully automatically, but you can specify it manually by
>> using the following form:
>> $ ./configure [$OTHER_OPTIONS] LIBLUA_PKG_CONFIG_NAME="lua"
>> 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