From 93a4558dddbea78a51171b2bf92e37da3ffb40dd Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 10 Jul 2014 12:49:53 +0530 Subject: client/rpc: Add ping and msgs stats This can be seen as below, ># cat $META/graphs/active/vol-client-0/private |grep ping_msgs_sent ping_msgs_sent = 2 ># cat $META/graphs/active/vol-client-0/private |grep "^msgs_sent" msgs_sent = 13 where $META is //.meta Change-Id: I2107ec2b045bac701377760635e18758adb943a3 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/8285 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Anand Avati --- rpc/rpc-lib/src/rpc-clnt-ping.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rpc/rpc-lib/src/rpc-clnt-ping.c') diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c index 948a244838e..21de9da4c1a 100644 --- a/rpc/rpc-lib/src/rpc-clnt-ping.c +++ b/rpc/rpc-lib/src/rpc-clnt-ping.c @@ -189,7 +189,9 @@ rpc_clnt_ping (struct rpc_clnt *rpc) { call_frame_t *frame = NULL; int32_t ret = -1; + rpc_clnt_connection_t *conn = NULL; + conn = &rpc->conn; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto fail; @@ -203,6 +205,13 @@ rpc_clnt_ping (struct rpc_clnt *rpc) gf_log (THIS->name, GF_LOG_ERROR, "failed to start ping timer"); } + else { + /* ping successfully queued in list of saved frames + * for the connection*/ + pthread_mutex_lock (&conn->lock); + conn->pingcnt++; + pthread_mutex_unlock (&conn->lock); + } return ret; -- cgit