Merge branch 'collectd-5.4'
[collectd.git] / src / mysql.c
index df1e7b6..7d5eddd 100644 (file)
@@ -38,8 +38,6 @@
 #include <mysql/mysql.h>
 #endif
 
-/* TODO: Understand `Select_*' and possibly do that stuff as well.. */
-
 struct mysql_database_s /* {{{ */
 {
        char *instance;
@@ -738,6 +736,16 @@ static int mysql_read (user_data_t *ud)
                        else if (strcmp (key, "Innodb_rows_updated") == 0)
                                counter_submit ("mysql_innodb_rows", "updated", val, db);
                }
+               else if (strncmp (key, "Select_", strlen ("Select_")) == 0)
+               {
+                       counter_submit ("mysql_select", key + strlen ("Select_"),
+                                       val, db);
+               }
+               else if (strncmp (key, "Sort_", strlen ("Sort_")) == 0)
+               {
+                       counter_submit ("mysql_sort", key + strlen ("Sort_"),
+                                       val, db);
+               }
        }
        mysql_free_result (res); res = NULL;