summaryrefslogtreecommitdiff
path: root/src/networking.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-01-14 10:20:02 +0100
committerantirez <antirez@gmail.com>2011-01-14 10:20:02 +0100
commit7a1fd61e3d3d7572ff7825f337206c19c992a83b (patch)
tree65fa45945383736779fe37d4e282ed28d8714781 /src/networking.c
parent3a73be752476f44dfb099863ac9424c2f27f2be0 (diff)
downloadredis-7a1fd61e3d3d7572ff7825f337206c19c992a83b.tar.gz
implemented two new INFO fields showing the size of clients max input and output buffers.
Diffstat (limited to 'src/networking.c')
-rw-r--r--src/networking.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index 6d232ecf7..55daff85d 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -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;
+}
+