redis plugin: Improve the types used for storing information.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Aug 2010 13:48:25 +0000 (15:48 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Aug 2010 13:48:25 +0000 (15:48 +0200)
src/redis.c
src/types.db

index c085963..1c01c3c 100644 (file)
@@ -24,7 +24,6 @@
 #include "common.h"
 #include "plugin.h"
 #include "configfile.h"
-#include "utils_avltree.h"
 
 #include <pthread.h>
 #include <credis.h>
@@ -271,17 +270,14 @@ static int redis_read (void) /* {{{ */
         info.total_connections_received, info.total_commands_processed,
         info.uptime_in_seconds);
 
-    redis_submit_g (rn->name, "connected_clients", NULL, info.connected_clients);
-    redis_submit_g (rn->name, "connected_slaves", NULL, info.connected_slaves);
-    redis_submit_g (rn->name, "used_memory", NULL, info.used_memory);
-    redis_submit_g (rn->name, "changes_since_last_save", NULL, info.changes_since_last_save);
-    redis_submit_g (rn->name, "bgsave_in_progress", NULL, info.bgsave_in_progress);
-    redis_submit_c (rn->name, "total_connections_received", NULL, info.total_connections_received);
-    redis_submit_c (rn->name, "total_commands_processed", NULL, info.total_commands_processed);
-    redis_submit_c (rn->name, "uptime_in_seconds", NULL, info.uptime_in_seconds);
+    redis_submit_g (rn->name, "current_connections", "clients", info.connected_clients);
+    redis_submit_g (rn->name, "current_connections", "slaves", info.connected_slaves);
+    redis_submit_g (rn->name, "memory", "used", info.used_memory);
+    redis_submit_g (rn->name, "volatile_changes", NULL, info.changes_since_last_save);
+    redis_submit_c (rn->name, "total_connections", NULL, info.total_connections_received);
+    redis_submit_c (rn->name, "total_operations", NULL, info.total_commands_processed);
 
     credis_close (rh);
-    status = 0;
   }
 
   return 0;
index e77ab99..f75e600 100644 (file)
@@ -27,6 +27,7 @@ counter                       value:COUNTER:U:U
 cpufreq                        value:GAUGE:0:U
 cpu                    value:COUNTER:0:4294967295
 current                        value:GAUGE:U:U
+current_connections    value:GAUGE:0:U
 delay                  seconds:GAUGE:-1000000:1000000
 derive                 value:DERIVE:0:U
 df                     used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623
@@ -157,6 +158,7 @@ time_dispersion             seconds:GAUGE:-1000000:1000000
 timeleft               timeleft:GAUGE:0:3600
 time_offset            seconds:GAUGE:-1000000:1000000
 total_bytes            value:DERIVE:0:U
+total_connections      value:DERIVE:0:U
 total_operations       value:DERIVE:0:U
 total_requests         value:DERIVE:0:U
 total_sessions         value:DERIVE:0:U
@@ -171,17 +173,10 @@ vmpage_action             value:COUNTER:0:4294967295
 vmpage_faults          minflt:COUNTER:0:9223372036854775807, majflt:COUNTER:0:9223372036854775807
 vmpage_io              in:COUNTER:0:4294967295, out:COUNTER:0:4294967295
 vmpage_number          value:GAUGE:0:4294967295
+volatile_changes       value:GAUGE:0:U
 voltage_threshold      value:GAUGE:U:U, threshold:GAUGE:U:U
 voltage                        value:GAUGE:U:U
 vs_memory              value:GAUGE:0:9223372036854775807
 vs_processes           value:GAUGE:0:65535
 vs_threads             value:GAUGE:0:65535
 pinba_view              req_per_sec:GAUGE:0:U, req_time:GAUGE:0:U, ru_utime:GAUGE:0:U, ru_stime:GAUGE:0:U, doc_size:GAUGE:0:U, mem_peak:GAUGE:0:U
-connected_clients   value:GAUGE:0:4294967295
-connected_slaves    value:GAUGE:0:4294967295
-used_memory         value:GAUGE:0:U
-changes_since_last_save    value:GAUGE:0:4294967295
-bgsave_in_progress     value:GAUGE:0:4294967295
-total_connections_received     value:COUNTER:0:9223372036854775807
-total_commands_processed      value:COUNTER:0:9223372036854775807
-uptime_in_seconds     value:COUNTER:0:4294967295