summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/monitoring.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2020-09-04 10:44:17 +0530
committerXavi Hernandez <xhernandez@redhat.com>2020-09-07 19:15:10 +0000
commit0935afb947e520fd8e41ebfc311888eafc6afdc0 (patch)
tree3a263636462fad5b661775ce83a5ab09e591413c /libglusterfs/src/monitoring.c
parentc696144b3690f7ed8cf04a8b51ca601f45e427ad (diff)
rpcsvc: Add latency tracking for rpc programs
Added latency tracking of rpc-handling code. With this change we should be able to monitor the amount of time rpc-handling code is consuming for each of the rpc call. fixes: #1466 Change-Id: I04fc7f3b12bfa5053c0fc36885f271cb78f581cd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/monitoring.c')
-rw-r--r--libglusterfs/src/monitoring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libglusterfs/src/monitoring.c b/libglusterfs/src/monitoring.c
index 45e3d776903..fbb68dc8622 100644
--- a/libglusterfs/src/monitoring.c
+++ b/libglusterfs/src/monitoring.c
@@ -113,15 +113,15 @@ dump_latency_and_count(xlator_t *xl, int fd)
dprintf(fd, "%s.interval.%s.fail_count %" PRIu64 "\n", xl->name,
gf_fop_list[index], cbk);
}
- if (xl->stats.interval.latencies[index].count != 0.0) {
+ if (xl->stats.interval.latencies[index].count != 0) {
dprintf(fd, "%s.interval.%s.latency %lf\n", xl->name,
gf_fop_list[index],
- (xl->stats.interval.latencies[index].total /
+ (((double)xl->stats.interval.latencies[index].total) /
xl->stats.interval.latencies[index].count));
- dprintf(fd, "%s.interval.%s.max %lf\n", xl->name,
+ dprintf(fd, "%s.interval.%s.max %" PRIu64 "\n", xl->name,
gf_fop_list[index],
xl->stats.interval.latencies[index].max);
- dprintf(fd, "%s.interval.%s.min %lf\n", xl->name,
+ dprintf(fd, "%s.interval.%s.min %" PRIu64 "\n", xl->name,
gf_fop_list[index],
xl->stats.interval.latencies[index].min);
}