From: Ning Yao Date: Wed, 11 Nov 2015 10:34:51 +0000 (+0800) Subject: ceph::buffer, Add cached_crc and cached_crc_adjust count in perf dump X-Git-Tag: v10.0.2~108^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b402f5f4a98992cd0fc5048010301b7cb4b3e74;p=ceph.git ceph::buffer, Add cached_crc and cached_crc_adjust count in perf dump in order to track the hit rate and efficiency of crc_cache Signed-off-by: Ning Yao --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c47aa5fb9785..7425cc7e6b6e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2244,6 +2244,8 @@ void OSD::create_logger() osd_plb.add_u64(l_osd_buf, "buffer_bytes", "Total allocated buffer size"); // total ceph::buffer bytes osd_plb.add_u64(l_osd_history_alloc_bytes, "history_alloc_Mbytes"); // total ceph::buffer bytes in history osd_plb.add_u64(l_osd_history_alloc_num, "history_alloc_num"); // total ceph::buffer num in history + osd_plb.add_u64(l_osd_cached_crc, "cached_crc", "Total number getting crc from crc_cache"); // total ceph::buffer buffer_cached_crc_adjusted + osd_plb.add_u64(l_osd_cached_crc_adjusted, "cached_crc_adjusted", "Total number getting crc from crc_cache with adjusting"); // total ceph::buffer buffer_cached_crc_adjusted osd_plb.add_u64(l_osd_pg, "numpg", "Placement groups"); // num pgs osd_plb.add_u64(l_osd_pg_primary, "numpg_primary", "Placement groups for which this osd is primary"); // num primary pgs @@ -3962,6 +3964,8 @@ void OSD::tick() logger->set(l_osd_buf, buffer::get_total_alloc()); logger->set(l_osd_history_alloc_bytes, SHIFT_ROUND_UP(buffer::get_history_alloc_bytes(), 20)); logger->set(l_osd_history_alloc_num, buffer::get_history_alloc_num()); + logger->set(l_osd_cached_crc, buffer::get_cached_crc()); + logger->set(l_osd_cached_crc_adjusted, buffer::get_cached_crc_adjusted()); if (is_active() || is_waiting_for_healthy()) { map_lock.get_read(); @@ -5947,6 +5951,8 @@ void OSD::_dispatch(Message *m) logger->set(l_osd_buf, buffer::get_total_alloc()); logger->set(l_osd_history_alloc_bytes, SHIFT_ROUND_UP(buffer::get_history_alloc_bytes(), 20)); logger->set(l_osd_history_alloc_num, buffer::get_history_alloc_num()); + logger->set(l_osd_cached_crc, buffer::get_cached_crc()); + logger->set(l_osd_cached_crc_adjusted, buffer::get_cached_crc_adjusted()); switch (m->get_type()) { diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 094d7d6fd277..367d236c059b 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -112,6 +112,8 @@ enum { l_osd_buf, l_osd_history_alloc_bytes, l_osd_history_alloc_num, + l_osd_cached_crc, + l_osd_cached_crc_adjusted, l_osd_pg, l_osd_pg_primary,