[collectd-changes] collectd, the system statistics collection daemon: Changes to 'ja/lua'

Florian Forster octo at verplant.org
Wed Nov 24 17:50:21 CET 2010


 contrib/collectd.lua |    2 +-
 src/lua.c            |  114 +++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 114 insertions(+), 2 deletions(-)

New commits:
commit 42fa6be9ebeb1fb386a99950ef5a835c40caf1fc
Author: Florian Forster <octo at noris.net>
Date:   Wed Nov 24 17:50:18 2010 +0100

    lua plugin: A first and very simple take at read callbacks.
    
    Apparently it's not possible to export a pointer to a Lua
    function to C. We therefore use the "registry" to store the
    callbacks there. They are fetched in "clua_read()" using
    
      lua_pushstring (l, function_name);
      lua_gettable (l, LUA_REGISTRYINDEX);
    
    It is now possible to register read callbacks using:
    
      collectd_register_read (function ()
        -- do some work here
        return 0;
      end);
    
    As a special case, global functions can be registered using
    function names, too. In that case they are looked up in the
    "globals" table.

commit e8aed8c5503e4c45f007a9894e719da4c4e0b2ea
Author: Florian Forster <octo at noris.net>
Date:   Wed Nov 24 17:44:32 2010 +0100

    contrib/collectd.lua: s/dofile/require/




More information about the collectd-changes mailing list