implemented two new INFO fields showing the size of clients max input and output buffers.

This commit is contained in:
antirez
2011-01-14 10:20:02 +01:00
parent 3a73be7524
commit 7a1fd61e3d
3 changed files with 26 additions and 0 deletions

View File

@ -820,3 +820,22 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) {
}
processInputBuffer(c);
}
void getClientsMaxBuffers(unsigned long *longest_output_list,
unsigned long *biggest_input_buffer) {
redisClient *c;
listNode *ln;
listIter li;
unsigned long lol = 0, bib = 0;
listRewind(server.clients,&li);
while ((ln = listNext(&li)) != NULL) {
c = listNodeValue(ln);
if (listLength(c->reply) > lol) lol = listLength(c->reply);
if (sdslen(c->querybuf) > bib) bib = sdslen(c->querybuf);
}
*longest_output_list = lol;
*biggest_input_buffer = bib;
}