summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-01-30 18:48:33 +0530
committerAmar Tumballi <amarts@redhat.com>2018-02-16 16:18:11 +0000
commite80c10d5e6fb97e132ff7f1c2846629fb5ad915f (patch)
tree69f5507def12d5443bb216ad4beafddb63ac3a80
parent664b946496368f625b5a15646b5aa791078055ef (diff)
downloadglusterfs-e80c10d5e6fb97e132ff7f1c2846629fb5ad915f.tar.gz
glusterfs-e80c10d5e6fb97e132ff7f1c2846629fb5ad915f.tar.xz
glusterfs-e80c10d5e6fb97e132ff7f1c2846629fb5ad915f.zip
metrics: set latency min value during xlator init
otherwise, the very first metrics will have all the min as 0. also no need to print pending-fops if it is 0. Updates #168 Change-Id: I233de6c92b1a73977bb468ba211ac6ec3c05298f Signed-off-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r--libglusterfs/src/monitoring.c3
-rw-r--r--libglusterfs/src/xlator.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/libglusterfs/src/monitoring.c b/libglusterfs/src/monitoring.c
index 25103867e2..62738c79e7 100644
--- a/libglusterfs/src/monitoring.c
+++ b/libglusterfs/src/monitoring.c
@@ -81,7 +81,8 @@ dump_latency_and_count (xlator_t *xl, int fd)
uint64_t cbk;
uint64_t count;
- dprintf (fd, "%s.total.winds.count %lu\n", xl->name, xl->winds);
+ if (xl->winds)
+ dprintf (fd, "%s.total.pending-winds.count %lu\n", xl->name, xl->winds);
/* Need 'fuse' data, and don't need all the old graph info */
if ((xl != xl->ctx->master) && (xl->ctx->active != xl->graph))
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index b060d39373..4071a7c056 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -217,6 +217,7 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle,
int xlator_dynload_oldway (xlator_t *xl)
{
+ int i = 0;
int ret = -1;
void *handle = NULL;
volume_opt_list_t *vol_opt = NULL;
@@ -300,6 +301,12 @@ int xlator_dynload_oldway (xlator_t *xl)
INIT_LIST_HEAD (&vol_opt->list);
list_add_tail (&vol_opt->list, &xl->volume_options);
+ /* make sure 'min' is set to high value, so it would be
+ properly set later */
+ for (i = 0; i < GF_FOP_MAXVALUE; i++) {
+ xl->stats.interval.latencies[i].min = 0xffffffff;
+ }
+
ret = 0;
out: