summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/xlator.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-09-12 23:01:46 +0530
committerXavier Hernandez <jahernan@redhat.com>2017-11-08 08:33:22 +0000
commitb79f29694165a65666d4177619d57b54641e4255 (patch)
tree13022c58cf0e13f4e3823776634086b93994e839 /libglusterfs/src/xlator.h
parentd109c7b79e15ab1940cd083636e867b1d4ed204e (diff)
xlator: add more metrics per fops
Make sure to handle these counters in STACK_WIND/UNWIND macro, and keep the counters as part of xlator_t structure itself, to provide infra to monitoring. Updates #137 Change-Id: Ib54d45e2321c2b095dac5810c37e6cdffe1f71b7 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/xlator.h')
-rw-r--r--libglusterfs/src/xlator.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index 430dbadd517..d802bdc76c3 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -923,6 +923,11 @@ typedef struct xlator_list {
struct xlator_list *next;
} xlator_list_t;
+typedef struct fop_metrics {
+ gf_atomic_t fop;
+ gf_atomic_t cbk; /* only updaed when there is failure */
+} fop_metrics_t;
+
struct _xlator {
/* Built during parsing */
char *name;
@@ -953,7 +958,18 @@ struct _xlator {
int64_t client_latency; /* This is in 'milliseconds' units */
struct {
/* for latency measurement */
+ fop_metrics_t metrics[GF_FOP_MAXVALUE];
+
+ gf_atomic_t count;
+ } total;
+
+ struct {
+ /* for latency measurement */
fop_latency_t latencies[GF_FOP_MAXVALUE];
+ /* for latency measurement */
+ fop_metrics_t metrics[GF_FOP_MAXVALUE];
+
+ gf_atomic_t count;
} interval;
} stats;