memcached plugin: Report uptime metric
authorPavel Rochnyack <pavel2000@ngs.ru>
Sun, 19 May 2019 17:30:32 +0000 (00:30 +0700)
committerPavel Rochnyack <pavel2000@ngs.ru>
Sun, 19 May 2019 17:30:32 +0000 (00:30 +0700)
Issue: #2852

src/memcached.c

index 0baf6c2..eb804d1 100644 (file)
@@ -509,6 +509,13 @@ static int memcached_read(user_data_t *user_data) {
     }
 
     /*
+     * Number of secs since the server started
+     */
+    else if (FIELD_IS("uptime")) {
+      submit_gauge("uptime", NULL, atof(fields[2]), st);
+    }
+
+    /*
      * Number of bytes used and available (total - used)
      */
     else if (FIELD_IS("bytes")) {