]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: perf counter for cache invalidates
authorMykola Golub <mgolub@mirantis.com>
Wed, 4 Nov 2015 10:18:52 +0000 (12:18 +0200)
committerMykola Golub <mgolub@mirantis.com>
Mon, 9 Nov 2015 14:14:11 +0000 (16:14 +0200)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/ImageCtx.cc
src/librbd/internal.cc
src/librbd/internal.h

index 031893c6e36dfb2e7ad31b89413b199642bcd019..ecb246ca39ada0d4412e84ec40de0aa8e26147ca 100644 (file)
@@ -294,6 +294,7 @@ public:
     plb.add_u64_counter(l_librbd_resize, "resize", "Resizes");
     plb.add_u64_counter(l_librbd_readahead, "readahead", "Read ahead");
     plb.add_u64_counter(l_librbd_readahead_bytes, "readahead_bytes", "Data size in read ahead");
+    plb.add_u64_counter(l_librbd_invalidate_cache, "invalidate_cache", "Cache invalidates");
 
     perfcounter = plb.create_perf_counters();
     cct->get_perfcounters_collection()->add(perfcounter);
index 812ef4593732c4d4b94aafe08172a2575e5267ce..da0c9bcf0d0fdf44ff581d68b5de13c3308ffd07 100644 (file)
@@ -3617,6 +3617,7 @@ reprotect_and_return_err:
     RWLock::RLocker owner_locker(ictx->owner_lock);
     RWLock::WLocker md_locker(ictx->md_lock);
     r = ictx->invalidate_cache();
+    ictx->perfcounter->inc(l_librbd_invalidate_cache);
     return r;
   }
 
index 3d35ee0bc29a1b07442af46d8f8a505ccf93bac2..4245b43f8108e0fdd29c63b4e5c776bf9962811e 100644 (file)
@@ -42,6 +42,8 @@ enum {
   l_librbd_readahead,
   l_librbd_readahead_bytes,
 
+  l_librbd_invalidate_cache,
+
   l_librbd_last,
 };