X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd-perl.pod;h=ee05e002d4fea57996ed5cf6543c38d166a35c13;hb=5efcb2fe5ca723225e4100314a8668d8abc9424a;hp=6b44722cfe808605603a549ac3690c5998bb1eb7;hpb=6bd4bf7b21f84746010792b885b9b71791dccb79;p=collectd.git diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index 6b44722c..ee05e002 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -208,7 +208,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', @@ -415,6 +415,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. @@ -494,6 +501,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. @@ -656,9 +668,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; }