]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Add throttle_get_started perf counter 12163/head
authorBartłomiej Święcki <bartlomiej.swiecki@corp.ovh.com>
Thu, 17 Nov 2016 16:26:28 +0000 (17:26 +0100)
committerBartłomiej Święcki <bartlomiej.swiecki@corp.ovh.com>
Fri, 2 Dec 2016 12:32:10 +0000 (13:32 +0100)
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 <bartlomiej.swiecki@corp.ovh.com>
src/common/Throttle.cc

index 7ba623252e26839e4611e3b53a7e83bdcc6e1890..343c67a08448f35e910f9c433d7267f75448860c 100644 (file)
@@ -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);