From db39236c6da4928fe0a740a3d65d61eed7ec7557 Mon Sep 17 00:00:00 2001 From: Aleksei Zakharov Date: Thu, 19 Oct 2017 09:58:30 +0000 Subject: [PATCH] ceph plugin: Move comment to right place --- src/ceph.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ceph.c b/src/ceph.c index bfd95e82..62acaf34 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -518,12 +518,6 @@ static int parse_keys(char *buffer, size_t buffer_size, const char *key_str) { size_t tmp_size = sizeof(tmp); const char *cut_suffixes[] = {".type", ".avgcount", ".sum", ".avgtime"}; - /* The "avgtime" metric reports ("sum" / "avgcount"), i.e. the average time - * per request since the start of the Ceph daemon. Report this only when the - * user has configured "long running average". Otherwise, use the rate of - * "sum" and "avgcount" to calculate the current latency. - */ - if (buffer == NULL || buffer_size == 0 || key_str == NULL || strlen(key_str) == 0) return EINVAL; @@ -933,7 +927,13 @@ static int node_handler_fetch_data(void *arg, const char *val, uv.gauge = result; vtmp->latency_index = (vtmp->latency_index + 1); } else if (has_suffix(key, ".avgtime")) { - // skip this step if no need in long run latency + + /* The "avgtime" metric reports ("sum" / "avgcount"), i.e. the average + * time per request since the start of the Ceph daemon. Report this only + * when the user has configured "long running average". Otherwise, use the + * rate of "sum" and "avgcount" to calculate the current latency. + */ + if (!long_run_latency_avg) { return 0; } -- 2.30.2