summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index f7f333001ee..3bd54a6fb3b 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -901,6 +901,49 @@ out:
return ret;
}
+int
+cli_cmd_volume_top_cbk (struct cli_state *state, struct cli_cmd_word *word,
+ const char **words, int wordcount)
+{
+
+ int ret = -1;
+ rpc_clnt_procedure_t *proc = NULL;
+ call_frame_t *frame = NULL;
+ dict_t *options = NULL;
+ int sent = 0;
+ int parse_error = 0;
+
+ ret = cli_cmd_volume_top_parse (words, wordcount, &options);
+
+ if (ret) {
+ parse_error = 1;
+ cli_usage_out (word->pattern);
+ goto out;
+ }
+
+ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_TOP_VOLUME];
+
+ frame = create_frame (THIS, THIS->ctx->pool);
+ if (!frame)
+ goto out;
+
+ if (proc->fn) {
+ ret = proc->fn (frame, THIS, options);
+ }
+
+out:
+ if (options)
+ dict_unref (options);
+
+ if (ret) {
+ cli_cmd_sent_status_get (&sent);
+ if ((sent == 0) && (parse_error == 0))
+ cli_out ("Volume top failed");
+ }
+
+ return ret;
+
+}
int
cli_cmd_log_locate_cbk (struct cli_state *state, struct cli_cmd_word *word,
@@ -1119,6 +1162,12 @@ struct cli_cmd volume_cmds[] = {
cli_cmd_quota_cbk,
"quota translator specific operations"},
+ { "volume top <VOLNAME> {[open|read|write|opendir|readdir] "
+ "|[read-perf|write-perf bs <size> count <count>]} "
+ " [brick <brick>] [list-cnt <count>]",
+ cli_cmd_volume_top_cbk,
+ "volume profile operations"},
+
{ NULL, NULL, NULL }
};