X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fceph.c;h=3accbd3f80d20a8d9b3c5c8e28af961c2d613aa9;hb=f46d76e976ed76d2d8fa297918ecd308680d7ae9;hp=488680aca01ddae277bf1b75c6c930663a8ac877;hpb=995fa04c33ba3e56b30421b8ab36b19613910e7d;p=collectd.git diff --git a/src/ceph.c b/src/ceph.c index 488680ac..3accbd3f 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -396,7 +396,7 @@ static void ceph_daemon_free(struct ceph_daemon *d) { } /* compact_ds_name removed the special characters ":", "_", "-" and "+" from the - * intput string. Characters following these special characters are capitalized. + * input string. Characters following these special characters are capitalized. * Trailing "+" and "-" characters are replaces with the strings "Plus" and * "Minus". */ static int compact_ds_name(char *buffer, size_t buffer_size, char const *src) { @@ -927,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; }