mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Sentinel: add more commonly useful sections to INFO.
Debugging is hard without those when there are problems like the one investigated in issue #2700.
This commit is contained in:
parent
4bc42ca7f6
commit
6233d210cd
@ -3165,6 +3165,16 @@ numargserr:
|
|||||||
(char*)c->argv[1]->ptr);
|
(char*)c->argv[1]->ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define info_section_from_redis(section_name) do { \
|
||||||
|
if (defsections || allsections || !strcasecmp(section,section_name)) { \
|
||||||
|
sds redissection; \
|
||||||
|
if (sections++) info = sdscat(info,"\r\n"); \
|
||||||
|
redissection = genRedisInfoString(section_name); \
|
||||||
|
info = sdscatlen(info,redissection,sdslen(redissection)); \
|
||||||
|
sdsfree(redissection); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
/* SENTINEL INFO [section] */
|
/* SENTINEL INFO [section] */
|
||||||
void sentinelInfoCommand(client *c) {
|
void sentinelInfoCommand(client *c) {
|
||||||
if (c->argc > 2) {
|
if (c->argc > 2) {
|
||||||
@ -3183,12 +3193,11 @@ void sentinelInfoCommand(client *c) {
|
|||||||
|
|
||||||
int sections = 0;
|
int sections = 0;
|
||||||
sds info = sdsempty();
|
sds info = sdsempty();
|
||||||
if (defsections || allsections || !strcasecmp(section,"server")) {
|
|
||||||
if (sections++) info = sdscat(info,"\r\n");
|
info_section_from_redis("server");
|
||||||
sds serversection = genRedisInfoString("server");
|
info_section_from_redis("clients");
|
||||||
info = sdscatlen(info,serversection,sdslen(serversection));
|
info_section_from_redis("cpu");
|
||||||
sdsfree(serversection);
|
info_section_from_redis("stats");
|
||||||
}
|
|
||||||
|
|
||||||
if (defsections || allsections || !strcasecmp(section,"sentinel")) {
|
if (defsections || allsections || !strcasecmp(section,"sentinel")) {
|
||||||
dictIterator *di;
|
dictIterator *di;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user