- /* typedef struct _cr_info {
- * char redis_version[CREDIS_VERSION_STRING_SIZE];
- * int bgsave_in_progress;
- * int connected_clients;
- * int connected_slaves;
- * unsigned int used_memory;
- * long long changes_since_last_save;
- * int last_save_time;
- * long long total_connections_received;
- * long long total_commands_processed;
- * int uptime_in_seconds;
- * int uptime_in_days;
- * int role;
- * } REDIS_INFO; */
-
- DEBUG ("redis plugin: received info from node `%s': connected_clients = %d; "
- "connected_slaves = %d; used_memory = %lu; changes_since_last_save = %lld; "
- "bgsave_in_progress = %d; total_connections_received = %lld; "
- "total_commands_processed = %lld; uptime_in_seconds = %ld", rn->name,
- info.connected_clients, info.connected_slaves, info.used_memory,
- info.changes_since_last_save, info.bgsave_in_progress,
- info.total_connections_received, info.total_commands_processed,
- 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_d (rn->name, "total_connections", NULL, info.total_connections_received);
- redis_submit_d (rn->name, "total_operations", NULL, info.total_commands_processed);
-
- credis_close (rh);
+ redis_handle_info (rn->name, rr->str, "uptime", NULL, "uptime_in_seconds", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "current_connections", "clients", "connected_clients", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "blocked_clients", NULL, "blocked_clients", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "memory", NULL, "used_memory", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "memory_lua", NULL, "used_memory_lua", DS_TYPE_GAUGE);
+ /* changes_since_last_save: Deprecated in redis version 2.6 and above */
+ redis_handle_info (rn->name, rr->str, "volatile_changes", NULL, "changes_since_last_save", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "total_connections", NULL, "total_connections_received", DS_TYPE_DERIVE);
+ redis_handle_info (rn->name, rr->str, "total_operations", NULL, "total_commands_processed", DS_TYPE_DERIVE);
+ redis_handle_info (rn->name, rr->str, "expired_keys", NULL, "expired_keys", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "pubsub", "channels", "pubsub_channels", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "pubsub", "patterns", "pubsub_patterns", DS_TYPE_GAUGE);
+ redis_handle_info (rn->name, rr->str, "current_connections", "slaves", "connected_slaves", DS_TYPE_GAUGE);
+
+ freeReplyObject (rr);
+
+ for (rq = rn->queries; rq != NULL; rq = rq->next)
+ redis_handle_query(rh, rn, rq);
+
+ redisFree (rh);