Code

src/utils_cache.c: Detect when a counter wraps around
[collectd.git] / src / plugin.c
index 007d094af8200f2d0245c67e479d42c61064f8f0..37c91a9ba2aa0d2fb79b5ec754d8d618ac0eb8f2 100644 (file)
@@ -31,6 +31,7 @@
 #include "plugin.h"
 #include "configfile.h"
 #include "utils_llist.h"
+#include "utils_cache.h"
 
 /*
  * Private structures
@@ -133,6 +134,7 @@ static int plugin_load_file (char *file)
                const char *error = lt_dlerror ();
 
                ERROR ("lt_dlopen failed: %s", error);
+               fprintf (stderr, "lt_dlopen failed: %s\n", error);
                return (1);
        }
 
@@ -355,6 +357,10 @@ int plugin_load (const char *type)
                        ret = 0;
                        break;
                }
+               else
+               {
+                       fprintf (stderr, "Unable to load plugin %s.\n", type);
+               }
        }
 
        closedir (dh);
@@ -544,6 +550,9 @@ void plugin_init_all (void)
                start_threads ((num > 0) ? num : 5);
        }
 
+       /* Init the value cache */
+       uc_init ();
+
        if (list_init == NULL)
                return;
 
@@ -673,6 +682,9 @@ int plugin_dispatch_values (const char *name, value_list_t *vl)
        escape_slashes (vl->plugin_instance, sizeof (vl->plugin_instance));
        escape_slashes (vl->type_instance, sizeof (vl->type_instance));
 
+       /* Update the value cache */
+       uc_update (ds, vl);
+
        le = llist_head (list_write);
        while (le != NULL)
        {