X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd-perl.pod;h=02563066de232a0c013859b482b8328a1a5f4301;hb=4371ef7f98f6f51ea3df34d5e26e175d6b44a328;hp=5637053360da8f0d7060f24f5264f6702c808592;hpb=5f3702fcc67d68d428708e9cf5e5897ad2578925;p=collectd.git diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index 56370533..02563066 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -1,3 +1,5 @@ +=encoding UTF-8 + =head1 NAME collectd-perl - Documentation of collectd's C @@ -200,7 +202,7 @@ layout looks like this: { values => [123, 0.5], time => time (), - interval => $interval_g, + interval => plugin_get_interval (), host => $hostname_g, plugin => 'myplugin', type => 'myplugin', @@ -368,11 +370,6 @@ is found (and the number of values matches the number of data-sources) then the type, data-set and value-list is passed to all write-callbacks that are registered with the daemon. -B: Prior to version 4.4 of collectd, the data-set type used to be passed -as the first argument to B. This syntax is still supported -for backwards compatibility but has been deprecated and will be removed in -some future version of collectd. - =item B ([B => I<...>][, B => I<...>], B => I<...>) @@ -397,23 +394,6 @@ argument has been specified, only named plugins will be flushed. The value of the B and B arguments may either be a string or a reference to an array of strings. -=item B (I, I) - -This is identical to using "plugin_flush (timeout =E I, plugins -=E I". - -B: Starting with version 4.5 of collectd, B has been -deprecated and will be removed in some future version of collectd. Use -B instead. - -=item B (I) - -This is identical to using "plugin_flush (timeout =E I)". - -B: Starting with version 4.5 of collectd, B has been -deprecated and will be removed in some future version of collectd. Use -B instead. - =item B (I) Submits a I to the daemon which will then pass it to all @@ -429,6 +409,13 @@ The message is passed to all log-callbacks that are registered with collectd. Wrappers around B, using B, B, B, B and B respectively as I. +=item B () + +Returns the interval of the current plugin as a floating point number in +seconds. This value depends on the interval configured within the +C block or the global interval (see L for +details). + =back The following function provides the filter chain C-interface to Perl-modules. @@ -508,6 +495,11 @@ B configuration options (see L for details). This variable keeps the interval in seconds in which the read functions are queried (see the B configuration option). +B This variable should no longer be used in favor of +C (see above). This function takes any plugin-specific +interval settings into account (see the C option of C in +L for details). + =back Any changes to these variables will be globally visible in collectd. @@ -670,9 +662,9 @@ A very simple read function might look like: sub foobar_read { - my $vl = { plugin => 'foobar' }; + my $vl = { plugin => 'foobar', type => 'gauge' }; $vl->{'values'} = [ rand(42) ]; - plugin_dispatch_values ('gauge', $vl); + plugin_dispatch_values ($vl); return 1; } @@ -713,7 +705,7 @@ types used by the read, write and match functions. =over 4 -=item +=item * Please feel free to send in new plugins to collectd's mailing list at EcollectdEatEverplant.orgE for review and, possibly, @@ -729,7 +721,7 @@ L. =over 4 -=item +=item * collectd is heavily multi-threaded. Each collectd thread accessing the perl plugin will be mapped to a Perl interpreter thread (see L). @@ -741,7 +733,7 @@ registered callback may be called more than once in parallel). Please note that no data is shared between threads by default. You have to use the B module to do so. -=item +=item * Each function name registered with collectd has to be available before the first thread has been created (i.Ee. basically at compile time). This @@ -750,14 +742,14 @@ C<*foo = \&bar; plugin_register (TYPE_READ, "plugin", "foo");> most likely will not work. This is due to the fact that the symbol table is not shared across different threads. -=item +=item * Each plugin is usually only loaded once and kept in memory for performance reasons. Therefore, END blocks are only executed once when collectd shuts down. You should not rely on END blocks anyway - use B instead. -=item +=item * The perl plugin exports the internal API of collectd which is considered unstable and subject to change at any time. We try hard to not break backwards @@ -771,7 +763,7 @@ dispatched by the perl plugin after upgrades. =over 4 -=item +=item * Currently, it is not possible to flush a single Perl plugin only. You can either flush all Perl plugins or none at all and you have to use C as