From 8e37815b4222420dadf3ae2c1c5589d7f197909c Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 21 Aug 2008 10:47:18 +0200 Subject: [PATCH] perl plugin: Pass on identifiers to Perl flush callbacks. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/collectd-perl.pod | 5 +++-- src/perl.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index dac80bf7..7cd5d72e 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -263,8 +263,9 @@ string. For the layout of I and I see above. =item TYPE_FLUSH -The only argument passed is I which indicates that only data older -than I seconds is to be flushed. +The arguments passed are I and I. I indicates +that only data older than I seconds is to be flushed. I +specifies which values are to be flushed. =item TYPE_LOG diff --git a/src/perl.c b/src/perl.c index e6bb25ef..81063607 100644 --- a/src/perl.c +++ b/src/perl.c @@ -767,8 +767,10 @@ static int pplugin_call_all (pTHX_ int type, ...) else if (PLUGIN_FLUSH == type) { /* * $_[0] = $timeout; + * $_[1] = $identifier; */ XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); + XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); } PUTBACK; @@ -1263,7 +1265,6 @@ static int perl_notify (const notification_t *notif) return pplugin_call_all (aTHX_ PLUGIN_NOTIF, notif); } /* static int perl_notify (const notification_t *) */ -/* TODO: Implement flushing of single identifiers. */ static int perl_flush (int timeout, const char *identifier) { dTHX; @@ -1280,7 +1281,7 @@ static int perl_flush (int timeout, const char *identifier) aTHX = t->interp; } - return pplugin_call_all (aTHX_ PLUGIN_FLUSH, timeout); + return pplugin_call_all (aTHX_ PLUGIN_FLUSH, timeout, identifier); } /* static int perl_flush (const int) */ static int perl_shutdown (void) -- 2.30.2