From: Bartłomiej Święcki Date: Thu, 17 Nov 2016 16:26:28 +0000 (+0100) Subject: common: Add throttle_get_started perf counter X-Git-Tag: v11.1.0~67^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c93517067418c563d5a120d6600fc16685aaa4b;p=ceph.git common: Add throttle_get_started perf counter This change adds 'get_started' performance counter which is increased at the beginning of Throttle::get() call, before any potential wait is started. It's purpose is to measure in realtime the number of jobs waiting for the throttle (get_started - get) and get the characteristic of get cals before throttler does it's job. Signed-off-by: Bartłomiej Święcki --- diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 7ba623252e2..343c67a0844 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -18,6 +18,7 @@ enum { l_throttle_first = 532430, l_throttle_val, l_throttle_max, + l_throttle_get_started, l_throttle_get, l_throttle_get_sum, l_throttle_get_or_fail_fail, @@ -45,6 +46,7 @@ Throttle::Throttle(CephContext *cct, const std::string& n, int64_t m, bool _use_ PerfCountersBuilder b(cct, string("throttle-") + name, l_throttle_first, l_throttle_last); b.add_u64(l_throttle_val, "val", "Currently available throttle"); b.add_u64(l_throttle_max, "max", "Max value for throttle"); + b.add_u64_counter(l_throttle_get_started, "get_started", "Number of get calls, increased before wait"); b.add_u64_counter(l_throttle_get, "get", "Gets"); b.add_u64_counter(l_throttle_get_sum, "get_sum", "Got data"); b.add_u64_counter(l_throttle_get_or_fail_fail, "get_or_fail_fail", "Get blocked during get_or_fail"); @@ -164,6 +166,9 @@ bool Throttle::get(int64_t c, int64_t m) assert(c >= 0); ldout(cct, 10) << "get " << c << " (" << count.read() << " -> " << (count.read() + c) << ")" << dendl; + if (logger) { + logger->inc(l_throttle_get_started); + } bool waited = false; { Mutex::Locker l(lock);