nmsg 1.3.1
|
Loading and calling external statistics modules. More...
Go to the source code of this file.
Functions | |
nmsg_statsmod_t | nmsg_statsmod_init (const char *name, const void *param, const size_t len_param) |
Initialize a statistics module with the given parameters. | |
void | nmsg_statsmod_destroy (nmsg_statsmod_t *statsmod) |
Destroy a statistics module. | |
nmsg_res | nmsg_statsmod_add_io (nmsg_statsmod_t statsmod, nmsg_io_t io, const char *name) |
Add an nmsg_io_t object to the statsmod instrumentation. | |
nmsg_res | nmsg_statsmod_remove_io (nmsg_statsmod_t statsmod, nmsg_io_t io) |
Remove an nmsg_io_t object from statsmod instrumentation. | |
Loading and calling external statistics modules.
This file defines the interface for loading and calling statistics modules. For the interface that developers of message filter modules must implement, see nmsg/statsmod_plugin.h.
Statistics modules allow statistics from an nmsg_io_t to be exported to an external metrics gathering system.
Definition in file statsmod.h.
nmsg_statsmod_t nmsg_statsmod_init | ( | const char * | name, |
const void * | param, | ||
const size_t | len_param | ||
) |
Initialize a statistics module with the given parameters.
Calls the module's 'module_init' function.
name | The name of the statistics module, which is used to construct the filesystem path to the shared object containing the module. This may either be a real, complete filesystem path (absolute or relative) that begins with "/" or "./", or it may be a short "convenience" name that will be expanded to a real filesystem path. For example, the short name "sample" might be expanded to a long name like "/usr/lib/nmsg/nmsg_stats1_sample.so". |
param | Pointer to a value that will be passed to the 'module_init' function. Specifies module-specific configuration. |
len_param | Length of the 'param' value. Passed to the 'module_init' function. |
void nmsg_statsmod_destroy | ( | nmsg_statsmod_t * | statsmod | ) |
Destroy a statistics module.
Calls the module's 'module_fini' function.
[in] | statsmod | Initialized statsmod. |
nmsg_res nmsg_statsmod_add_io | ( | nmsg_statsmod_t | statsmod, |
nmsg_io_t | io, | ||
const char * | name | ||
) |
Add an nmsg_io_t object to the statsmod instrumentation.
statsmod | The stats module returned from nmsg_statsmod_init(). |
io | The nmsg_io_t object to instrument. |
name | A unique name to use when publishing stats for this io. |
nmsg_res nmsg_statsmod_remove_io | ( | nmsg_statsmod_t | statsmod, |
nmsg_io_t | io | ||
) |
Remove an nmsg_io_t object from statsmod instrumentation.
Either nmsg_statsmod_remove_io(io)
or nmsg_statsmod_destroy(mod)
must be called before nmsg_io_destroy(io)
.
statsmod | The stats module returned from nmsg_statsmod_init(). |
io | The nmsg_io_t object to remove. |