Code

src/plugin.c: Report an error if ctx.interval is not set.
authorFlorian Forster <octo@collectd.org>
Wed, 14 Nov 2012 12:07:47 +0000 (13:07 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 14 Nov 2012 12:07:47 +0000 (13:07 +0100)
src/plugin.c

index 9d10631df22faec6939292fdec0fcba0cc6945c8..22f89696d6d0bba6d51c168fdf0ebaebd836e9b7 100644 (file)
@@ -1544,13 +1544,25 @@ int plugin_dispatch_values (value_list_t *vl)
        if (vl->time == 0)
                vl->time = cdtime ();
 
-       if (vl->interval <= 0) {
+       if (vl->interval <= 0)
+       {
                plugin_ctx_t ctx = plugin_get_ctx ();
 
                if (ctx.interval != 0)
                        vl->interval = ctx.interval;
                else
+               {
+                       char name[6 * DATA_MAX_NAME_LEN];
+                       FORMAT_VL (name, sizeof (name), vl);
+                       ERROR ("plugin_dispatch_values: Unable to determine "
+                                       "interval from context for "
+                                       "value list \"%s\". "
+                                       "This indicates a broken plugin. "
+                                       "Please report this problem to the "
+                                       "collectd mailing list or at "
+                                       "<http://collectd.org/bugs/>.", name);
                        vl->interval = interval_g;
+               }
        }
 
        DEBUG ("plugin_dispatch_values: time = %.3f; interval = %.3f; "