X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/5b8ce85378f3b0887db254a20d1ae2cb7ad0ad55..0a0f83ab2c02ebf1a9029a473e23ef72d037cac0:/src/redis.c diff --git a/src/redis.c b/src/redis.c index f8000180..603b377f 100644 --- a/src/redis.c +++ b/src/redis.c @@ -583,7 +583,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { if ((server.maxidletime && !(loops % 100)) || server.bpop_blocked_clients) closeTimedoutClients(); - /* Check if a background saving or AOF rewrite in progress terminated */ + /* Check if a background saving or AOF rewrite in progress terminated. */ if (server.bgsavechildpid != -1 || server.bgrewritechildpid != -1) { int statloc; pid_t pid; @@ -601,6 +601,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { } updateDictResizePolicy(); } + } else if (server.bgsavethread != (pthread_t) -1) { if (server.bgsavethread != (pthread_t) -1) { int state; @@ -1299,6 +1300,19 @@ sds genRedisInfoString(void) { eta ); } + + info = sdscat(info,"allocation_stats:"); + for (j = 0; j <= ZMALLOC_MAX_ALLOC_STAT; j++) { + size_t count = zmalloc_allocations_for_size(j); + if (count) { + if (info[sdslen(info)-1] != ':') info = sdscatlen(info,",",1); + info = sdscatprintf(info,"%s%d=%zu", + (j == ZMALLOC_MAX_ALLOC_STAT) ? ">=" : "", + j,count); + } + } + info = sdscat(info,"\r\n"); + for (j = 0; j < server.dbnum; j++) { long long keys, vkeys;