From c6053cac7794dfd9bf693e91cd76c2a45d7859eb Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 20 Jul 2011 12:35:14 +0530 Subject: debug/io-stats: print the time at which maximum fds were open in gluster top Change-Id: I257bc29945d5acf8fb316f396fb011a2ab652d7a BUG: 3076 Reviewed-on: http://review.gluster.com/54 Tested-by: Gluster Build System Reviewed-by: Shishir Gowda --- cli/src/cli-rpc-ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 26e78dca..50a2631a 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3298,6 +3298,7 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, long int time_usec = 0; struct tm *tm = NULL; char timestr[256] = {0, }; + char *openfd_str = NULL; if (-1 == req->rpc_status) { goto out; @@ -3370,10 +3371,15 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, break; snprintf (key, sizeof (key), "%d-max-open", i); ret = dict_get_uint64 (dict, key, &max_nr_open); + if (ret) + goto out; + snprintf (key, sizeof (key), "%d-max-openfd-time", i); + ret = dict_get_str (dict, key, &openfd_str); if (ret) goto out; cli_out ("Current open fds: %"PRIu64", Max open" - " fds: %"PRIu64, nr_open, max_nr_open); + " fds: %"PRIu64", Max openfd time: %s", nr_open, + max_nr_open, openfd_str); case GF_CLI_TOP_READ: case GF_CLI_TOP_WRITE: case GF_CLI_TOP_OPENDIR: -- cgit