]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: add omap op perf counters
authorJohn Spray <john.spray@redhat.com>
Thu, 19 Feb 2015 11:01:21 +0000 (11:01 +0000)
committerJohn Spray <john.spray@redhat.com>
Fri, 6 Mar 2015 11:03:56 +0000 (11:03 +0000)
To avoid bloating the list of counters too much,
group the OMAP operations in to wr,rd,del

Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/Objecter.cc

index b4792d65e8ca915dd2b84dbcbdb6124fc3b06f77..b0d64b7afa1192e3a241f83ba5d45eee82492815 100644 (file)
@@ -129,6 +129,11 @@ enum {
   l_osdc_osd_session_open,
   l_osdc_osd_session_close,
   l_osdc_osd_laggy,
+
+  l_osdc_osdop_omap_wr,
+  l_osdc_osdop_omap_rd,
+  l_osdc_osdop_omap_del,
+
   l_osdc_last,
 };
 
@@ -254,6 +259,10 @@ void Objecter::init()
     pcb.add_u64_counter(l_osdc_osd_session_close, "osd_session_close");
     pcb.add_u64(l_osdc_osd_laggy, "osd_laggy");
 
+    pcb.add_u64_counter(l_osdc_osdop_omap_wr, "omap_wr");
+    pcb.add_u64_counter(l_osdc_osdop_omap_rd, "omap_rd");
+    pcb.add_u64_counter(l_osdc_osdop_omap_del, "omap_del");
+
     logger = pcb.create_perf_counters();
     cct->get_perfcounters_collection()->add(logger);
   }
@@ -2069,6 +2078,22 @@ void Objecter::_send_op_account(Op *op)
     case CEPH_OSD_OP_TMAPUP: code = l_osdc_osdop_tmap_up; break;
     case CEPH_OSD_OP_TMAPPUT: code = l_osdc_osdop_tmap_put; break;
     case CEPH_OSD_OP_TMAPGET: code = l_osdc_osdop_tmap_get; break;
+
+    // OMAP read operations
+    case CEPH_OSD_OP_OMAPGETVALS:
+    case CEPH_OSD_OP_OMAPGETKEYS:
+    case CEPH_OSD_OP_OMAPGETHEADER:
+    case CEPH_OSD_OP_OMAPGETVALSBYKEYS:
+    case CEPH_OSD_OP_OMAP_CMP: code = l_osdc_osdop_omap_rd; break;
+
+    // OMAP write operations
+    case CEPH_OSD_OP_OMAPSETVALS:
+    case CEPH_OSD_OP_OMAPSETHEADER: code = l_osdc_osdop_omap_wr; break;
+
+    // OMAP del operations
+    case CEPH_OSD_OP_OMAPCLEAR:
+    case CEPH_OSD_OP_OMAPRMKEYS: code = l_osdc_osdop_omap_del; break;
+
     case CEPH_OSD_OP_CALL: code = l_osdc_osdop_call; break;
     case CEPH_OSD_OP_WATCH: code = l_osdc_osdop_watch; break;
     case CEPH_OSD_OP_NOTIFY: code = l_osdc_osdop_notify; break;