mysql: [impr] enable uptime metric
authorSK <skob@me.com>
Tue, 12 Mar 2019 20:26:17 +0000 (23:26 +0300)
committerSK <skob@me.com>
Tue, 12 Mar 2019 20:26:17 +0000 (23:26 +0300)
src/mysql.c
src/types.db

index 7399fe2..54ffc9d 100644 (file)
@@ -905,6 +905,8 @@ static int mysql_read(user_data_t *ud) {
 
     } else if (strncmp(key, "Slow_queries", strlen("Slow_queries")) == 0) {
       derive_submit("mysql_slow_queries", NULL, val, db);
+    } else if (strncmp(key, "Uptime", strlen("Uptime")) == 0) {
+      gauge_submit("mysql_uptime", NULL, val, db);
     }
   }
   mysql_free_result(res);
index 69f59b0..3f33ca7 100644 (file)
@@ -165,6 +165,7 @@ mysql_sort              value:DERIVE:0:U
 mysql_sort_merge_passes value:DERIVE:0:U
 mysql_sort_rows         value:DERIVE:0:U
 mysql_slow_queries      value:DERIVE:0:U
+mysql_uptime            value:GAUGE:0:4294967295
 nfs_procedure           value:DERIVE:0:U
 nginx_connections       value:GAUGE:0:U
 nginx_requests          value:DERIVE:0:U