diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2020-09-04 10:44:17 +0530 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2020-09-07 19:15:10 +0000 |
commit | 0935afb947e520fd8e41ebfc311888eafc6afdc0 (patch) | |
tree | 3a263636462fad5b661775ce83a5ab09e591413c /libglusterfs/src/glusterfs/latency.h | |
parent | c696144b3690f7ed8cf04a8b51ca601f45e427ad (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/glusterfs/latency.h')
-rw-r--r-- | libglusterfs/src/glusterfs/latency.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libglusterfs/src/glusterfs/latency.h b/libglusterfs/src/glusterfs/latency.h index ed47b1f0cbc..4d601bbcbd6 100644 --- a/libglusterfs/src/glusterfs/latency.h +++ b/libglusterfs/src/glusterfs/latency.h @@ -11,13 +11,23 @@ #ifndef __LATENCY_H__ #define __LATENCY_H__ -#include "glusterfs/glusterfs.h" +#include <inttypes.h> +#include <time.h> -typedef struct fop_latency { - double min; /* min time for the call (microseconds) */ - double max; /* max time for the call (microseconds) */ - double total; /* total time (microseconds) */ +typedef struct _gf_latency { + uint64_t min; /* min time for the call (nanoseconds) */ + uint64_t max; /* max time for the call (nanoseconds) */ + uint64_t total; /* total time (nanoseconds) */ uint64_t count; -} fop_latency_t; +} gf_latency_t; +gf_latency_t * +gf_latency_new(size_t n); + +void +gf_latency_reset(gf_latency_t *lat); + +void +gf_latency_update(gf_latency_t *lat, struct timespec *begin, + struct timespec *end); #endif /* __LATENCY_H__ */ |