summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-rpc-ops.c25
-rw-r--r--cli/src/cli-xml-output.c44
2 files changed, 68 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 6b5277ced95..12f54f61f23 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -30,6 +30,7 @@
#include "protocol-common.h"
#include "cli-mem-types.h"
#include "compat.h"
+#include "upcall-utils.h"
#include "syscall.h"
#include "glusterfs3.h"
@@ -6276,6 +6277,7 @@ cmd_profile_volume_brick_out (dict_t *dict, int count, int interval)
uint64_t rb_counts[32] = {0};
uint64_t wb_counts[32] = {0};
cli_profile_info_t profile_info[GF_FOP_MAXVALUE] = {{0}};
+ cli_profile_info_t upcall_info[GF_UPCALL_FLAGS_MAXVALUE] = {{0},};
char output[128] = {0};
int per_line = 0;
char read_blocks[128] = {0};
@@ -6299,6 +6301,13 @@ cmd_profile_volume_brick_out (dict_t *dict, int count, int interval)
ret = dict_get_uint64 (dict, key, &wb_counts[i]);
}
+ for (i = 0; i < GF_UPCALL_FLAGS_MAXVALUE; i++) {
+ snprintf (key, sizeof (key), "%d-%d-%d-upcall-hits", count,
+ interval, i);
+ ret = dict_get_uint64 (dict, key, &upcall_info[i].fop_hits);
+ upcall_info[i].fop_name = (char *)gf_upcall_list[i];
+ }
+
for (i = 0; i < GF_FOP_MAXVALUE; i++) {
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%d-%d-%d-hits", count,
@@ -6423,6 +6432,22 @@ cmd_profile_volume_brick_out (dict_t *dict, int count, int interval)
profile_info[i].fop_name);
}
}
+
+ for (i = 0; i < GF_UPCALL_FLAGS_MAXVALUE; i++) {
+ if (upcall_info[i].fop_hits == 0)
+ continue;
+ if (upcall_info[i].fop_hits) {
+ cli_out ("%10.2lf %10.2lf us %10.2lf us %10.2lf us"
+ " %14"PRId64" %11s",
+ upcall_info[i].percentage_avg_latency,
+ upcall_info[i].avg_latency,
+ upcall_info[i].min_latency,
+ upcall_info[i].max_latency,
+ upcall_info[i].fop_hits,
+ upcall_info[i].fop_name);
+ }
+ }
+
cli_out (" ");
cli_out ("%12s: %"PRId64" seconds", "Duration", sec);
cli_out ("%12s: %"PRId64" bytes", "Data Read", r_count);
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 6639262066c..af4f020bbbd 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -13,7 +13,7 @@
#include "run.h"
#include "compat.h"
#include "syscall.h"
-
+#include "upcall-utils.h"
enum gf_task_types {
GF_TASK_TYPE_REBALANCE,
@@ -2200,6 +2200,48 @@ cont:
max_latency = 0.0;
}
+ for (i = 0; i < GF_UPCALL_FLAGS_MAXVALUE; i++) {
+ hits = 0;
+ avg_latency = 0.0;
+ min_latency = 0.0;
+ max_latency = 0.0;
+
+ memset (key, 0, sizeof (key));
+ snprintf (key, sizeof (key), "%d-%d-%d-upcall-hits", brick_index,
+ interval, i);
+ ret = dict_get_uint64 (dict, key, &hits);
+ if (ret)
+ continue;
+
+ /* <fop> */
+ ret = xmlTextWriterStartElement (writer, (xmlChar *)"fop");
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement
+ (writer, (xmlChar *)"name", "%s", gf_fop_list[i]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement
+ (writer, (xmlChar *)"hits", "%"PRIu64, hits);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement
+ (writer, (xmlChar *)"avgLatency", "%f", avg_latency);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement
+ (writer, (xmlChar *)"minLatency", "%f", min_latency);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement
+ (writer, (xmlChar *)"maxLatency", "%f", max_latency);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ /* </fop> */
+ ret = xmlTextWriterEndElement (writer);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+ }
+
/* </fopStats> */
ret = xmlTextWriterEndElement (writer);
XML_RET_CHECK_AND_GOTO (ret, out);