]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
throttle: count get_or_fail success/failure explicitly
authorSage Weil <sage@newdream.net>
Tue, 1 May 2012 17:47:05 +0000 (10:47 -0700)
committerSage Weil <sage@newdream.net>
Tue, 1 May 2012 17:47:05 +0000 (10:47 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/common/Throttle.cc

index 33bc57064287de9095a8bfc27432432871f7e28d..c04c4b9085203521353b5c9b4d180d21afd0beb9 100644 (file)
@@ -15,7 +15,8 @@ enum {
   l_throttle_max,
   l_throttle_get,
   l_throttle_get_sum,
-  l_throttle_get_fail,
+  l_throttle_get_or_fail_fail,
+  l_throttle_get_or_fail_success,
   l_throttle_take,
   l_throttle_take_sum,
   l_throttle_put,
@@ -36,7 +37,8 @@ Throttle::Throttle(CephContext *cct, std::string n, int64_t m)
   b.add_u64_counter(l_throttle_max, "max");
   b.add_u64_counter(l_throttle_get, "get");
   b.add_u64_counter(l_throttle_get_sum, "get_sum");
-  b.add_u64_counter(l_throttle_get_fail, "get_fail");
+  b.add_u64_counter(l_throttle_get_or_fail_fail, "get_or_fail_fail");
+  b.add_u64_counter(l_throttle_get_or_fail_success, "get_or_fail_success");
   b.add_u64_counter(l_throttle_take, "take");
   b.add_u64_counter(l_throttle_take_sum, "take_sum");
   b.add_u64_counter(l_throttle_put, "put");
@@ -149,11 +151,12 @@ bool Throttle::get_or_fail(int64_t c)
   Mutex::Locker l(lock);
   if (_should_wait(c) || !cond.empty()) {
     ldout(cct, 2) << "get_or_fail " << c << " failed" << dendl;
-    logger->inc(l_throttle_get_fail);
+    logger->inc(l_throttle_get_or_fail_fail);
     return false;
   } else {
     ldout(cct, 5) << "get_or_fail " << c << " success (" << count << " -> " << (count + c) << ")" << dendl;
     count += c;
+    logger->inc(l_throttle_get_or_fail_success);
     logger->inc(l_throttle_get);
     logger->inc(l_throttle_get_sum, c);
     logger->set(l_throttle_val, count);