From 8c93517067418c563d5a120d6600fc16685aaa4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bart=C5=82omiej=20=C5=9Awi=C4=99cki?= Date: Thu, 17 Nov 2016 17:26:28 +0100 Subject: [PATCH] common: Add throttle_get_started perf counter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/Throttle.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 7ba623252e26..343c67a08448 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); -- 2.47.3