Merge pull request #774 from trenkel/master
authorSebastian Harl <sh@tokkee.org>
Sat, 25 Oct 2014 07:17:37 +0000 (09:17 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 25 Oct 2014 07:17:37 +0000 (09:17 +0200)
Adding get_dataset() to python

src/collectd-python.pod
src/mysql.c
src/python.c

index fc5376e..d04d0f0 100644 (file)
@@ -63,7 +63,7 @@ locale.
 
 =item B<ModulePath> I<Name>
 
-Appends I<Name> to B<sys.path>. You won't be able to import any scripts you
+Prepends I<Name> to B<sys.path>. You won't be able to import any scripts you
 wrote unless they are located in one of the directories in this list. Please
 note that it only has effect on plugins loaded after this option. You can
 use multiple B<ModulePath> lines to add more than one directory.
index 7d5eddd..f5ae1ad 100644 (file)
@@ -688,7 +688,7 @@ static int mysql_read (user_data_t *ud)
                        else if (strcmp (key, "Innodb_buffer_pool_pages_dirty") == 0)
                                gauge_submit ("mysql_bpool_pages", "dirty", val, db);
                        else if (strcmp (key, "Innodb_buffer_pool_pages_flushed") == 0)
-                               counter_submit ("mysql_bpool_counters", "flushed", val, db);
+                               counter_submit ("mysql_bpool_pages", "flushed", val, db);
                        else if (strcmp (key, "Innodb_buffer_pool_pages_free") == 0)
                                gauge_submit ("mysql_bpool_pages", "free", val, db);
                        else if (strcmp (key, "Innodb_buffer_pool_pages_misc") == 0)
@@ -716,7 +716,7 @@ static int mysql_read (user_data_t *ud)
                        else if (strcmp (key, "Innodb_data_reads") == 0)
                                counter_submit ("mysql_innodb_data", "reads", val, db);
                        else if (strcmp (key, "Innodb_data_writes") == 0)
-                               counter_submit ("mysql_bpool_counters", "writes", val, db);
+                               counter_submit ("mysql_innodb_data", "writes", val, db);
                        else if (strcmp (key, "Innodb_data_written") == 0)
                                counter_submit ("mysql_innodb_data", "written", val, db);
 
index af2dc5b..0fad6fa 100644 (file)
@@ -1153,8 +1153,8 @@ static int cpy_config(oconfig_item_t *ci) {
                                cpy_log_exception("python initialization");
                                continue;
                        }
-                       if (PyList_Append(sys_path, dir_object) != 0) {
-                               ERROR("python plugin: Unable to append \"%s\" to "
+                       if (PyList_Insert(sys_path, 0, dir_object) != 0) {
+                               ERROR("python plugin: Unable to prepend \"%s\" to "
                                      "python module path.", dir);
                                cpy_log_exception("python initialization");
                        }