The following proposed patch for stable 3.1, changes the semantics of
the language module directive to better reflect it defines a "C" interface
that could be used by "C", "Objective C" or in the future "C++" source
modules.

This version includes all changes from all 2 previous proposals and includes
all received comments, including changes in the documentation that are
specific to the 3.1 branch as they are meant to be temporary until "C++"
support is backported.

Carlo
---
Index: ganglia.pod
===================================================================
--- ganglia.pod (revision 1531)
+++ ganglia.pod (working copy)
@@ -599,11 +599,11 @@
 There are currently two ways in which metric modules can be written and 
plugged into Gmond in order 
 to extend the types of metrics that Ganglia is able to monitor.  As of Ganglia 
3.1, a pluggable 
 interface has been added to allow the Gmond metric gathering agent to collect 
any type of metric 
-that can be acquired through programatic means.  The primary metric module 
interface is C with a 
+that can be acquired through programatic means.  The primary metric module 
interface is C (as defined by the header file gm_metric.h) with a
 secondary python interface.  This means that pluggable modules can either be 
written and compiled 
-into dynamically loadable C based language modules or written and deployed as 
python pluggable modules.  
+into dynamically loadable DSO modules or written and deployed as python 
pluggable modules.  
 
-The basic steps when writting a pluggable module either in C or in python, is 
as follows:
+The basic steps when writting a pluggable module either in C (including 
"Objective C but not yet C++) or in python, is as follows:
 
 =over 4
 
Index: gmond/gmond.c
===================================================================
--- gmond/gmond.c       (revision 1531)
+++ gmond/gmond.c       (working copy)
@@ -1637,7 +1637,7 @@
            delegated to an alternate module interface
         */
         modLanguage = cfg_getstr(module, "language");
-        if (modLanguage && strcasecmp(modLanguage, "C/C++")) 
+        if (modLanguage && strcasecmp(modLanguage, "C")) 
             continue;
 
         modPath = cfg_getstr(module, "path");
Index: gmond/conf.pod
===================================================================
--- gmond/conf.pod      (revision 1531)
+++ gmond/conf.pod      (working copy)
@@ -357,19 +357,21 @@
 extends the available metrics that gmond is able to collect. Each B<modules>
 section contains at least one B<module> section.  Within a B<module> section
 are the directives B<name>, B<language>, B<path> and B<params>.  The module 
-B<name> is the name of the module as determined by the module structure if
-the module was developed in C/C++.  Alternatively, the B<name> can be 
-the name of the source file if the module has been implemented in a 
-interpreted language such as python.  A B<language> designation must be 
-specified as a string value for each module.  The B<language> directive 
-must correspond to the source code language in which the module was 
-implemented (ex. language = "python").  If a B<language> directive does 
-not exist for the module, the assumed language will be "C/C++". The B<path> 
-is the path from which gmond is expected to load the module (C/C++ compiled 
-dynamically loadable module only).  The B<params> directive can be used 
-to pass a single string parameter directly to the module initialization 
-function (C/C++ module only). Multiple parameters can be passed to the 
-module's initialization function by including one or more B<param> sections. 
+B<name> is the name of the module structure (defined by the C interface) if
+referring to a compiled DSO; alternatively, the B<name> can be the name of
+the source file to the module if it has been implemented in an interpreted
+language such as python.  A B<language> designation must be specified as a case
+insensitive string value identifying the source code language in which the
+module was implemented (ex. language = "python") when using an interpreted
+language.  If a B<language> directive does not exist then the module is 
+expected to be a compiled DSO.  Optionally, a B<language> directive of
+"C" can be used to indicate it is a compiled DSO that can be loaded by gmond
+directly. The B<path> is the path from which gmond is expected to load the
+module (only valid for compiled DSO modules).  The B<params> directive can be
+used to pass a single string parameter directly to the module initialization
+function (only valid for compiled DSO modules). Multiple parameters can be
+passed to the module's initialization function by including one or more
+B<param> sections. 
 Each B<param> section must be named and contain a B<value> directive. Once 
 a module has been loaded, the additional metrics can be discovered by 
 invoking B<gmond -m>.
@@ -377,7 +379,6 @@
    modules {
      module {
        name = "example_module"
-       language = "C/C++"
        path = "/usr/lib/ganglia/modules/modexample.so"
        params = "An extra raw parameter"
        param RandomMax {
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to