]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: handle perfcounter for writesame separately
authorGui Hecheng <guihecheng@cmss.chinamobile.com>
Tue, 21 Feb 2017 07:21:56 +0000 (15:21 +0800)
committerGui Hecheng <guihecheng@cmss.chinamobile.com>
Thu, 23 Feb 2017 09:25:24 +0000 (17:25 +0800)
Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
src/librbd/ImageCtx.cc
src/librbd/internal.h
src/librbd/io/AioCompletion.cc
src/librbd/io/ImageRequest.cc

index d16c0a5725617757f6ddb9c4aa18d36915178ebc..d16e8c14a878ef45ee6915cad487b8bc400045a5 100644 (file)
@@ -369,6 +369,9 @@ struct C_InvalidateCache : public Context {
     plb.add_u64_counter(l_librbd_flush, "flush", "Flushes");
     plb.add_u64_counter(l_librbd_aio_flush, "aio_flush", "Async flushes");
     plb.add_time_avg(l_librbd_aio_flush_latency, "aio_flush_latency", "Latency of async flushes");
+    plb.add_u64_counter(l_librbd_ws, "ws", "WriteSames");
+    plb.add_u64_counter(l_librbd_ws_bytes, "ws_bytes", "WriteSame data");
+    plb.add_time_avg(l_librbd_ws_latency, "ws_latency", "WriteSame latency");
     plb.add_u64_counter(l_librbd_snap_create, "snap_create", "Snap creations");
     plb.add_u64_counter(l_librbd_snap_remove, "snap_remove", "Snap removals");
     plb.add_u64_counter(l_librbd_snap_rollback, "snap_rollback", "Snap rollbacks");
index 64be3a1810f706a4703df4086e1992fb787e4688..9fed529d016e9bde9c04b163a1cd368ed1bc094d 100644 (file)
@@ -33,6 +33,9 @@ enum {
 
   l_librbd_aio_flush,
   l_librbd_aio_flush_latency,
+  l_librbd_ws,
+  l_librbd_ws_bytes,
+  l_librbd_ws_latency,
 
   l_librbd_snap_create,
   l_librbd_snap_remove,
index 812fbc9e0e33dbef7982b0a59a293bcb841aa981..ecc0445efdae288988e1ff6535e2848e64b75fca 100644 (file)
@@ -70,6 +70,8 @@ void AioCompletion::complete() {
     ictx->perfcounter->tinc(l_librbd_discard_latency, elapsed); break;
   case AIO_TYPE_FLUSH:
     ictx->perfcounter->tinc(l_librbd_aio_flush_latency, elapsed); break;
+  case AIO_TYPE_WRITESAME:
+    ictx->perfcounter->tinc(l_librbd_ws_latency, elapsed); break;
   default:
     lderr(cct) << "completed invalid aio_type: " << aio_type << dendl;
     break;
index 44b6ea1813b538a591437d41a2106a5defaa3ae7..ee9d9535b2a9696cdca8f4960acc55ec75f6d119 100644 (file)
@@ -804,8 +804,8 @@ ObjectRequestHandle *ImageWriteSameRequest<I>::create_object_request(
 template <typename I>
 void ImageWriteSameRequest<I>::update_stats(size_t length) {
   I &image_ctx = this->m_image_ctx;
-  image_ctx.perfcounter->inc(l_librbd_wr);
-  image_ctx.perfcounter->inc(l_librbd_wr_bytes, length);
+  image_ctx.perfcounter->inc(l_librbd_ws);
+  image_ctx.perfcounter->inc(l_librbd_ws_bytes, length);
 }
 
 } // namespace io