From 3ab1895708fb7649539c798fa45b46e739ec7660 Mon Sep 17 00:00:00 2001 From: yuwmao Date: Mon, 24 Jun 2024 17:10:38 +0800 Subject: [PATCH] Remove AppendBlkAllocMetrics --- conanfile.py | 2 +- src/lib/blkalloc/append_blk_allocator.cpp | 8 +++--- src/lib/blkalloc/append_blk_allocator.h | 32 +++++++++++------------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/conanfile.py b/conanfile.py index ae350b5bd..683f93982 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "6.4.22" + version = "6.4.23" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" topics = ("ebay", "nublox") diff --git a/src/lib/blkalloc/append_blk_allocator.cpp b/src/lib/blkalloc/append_blk_allocator.cpp index b000f3ec5..c7d18e0b1 100644 --- a/src/lib/blkalloc/append_blk_allocator.cpp +++ b/src/lib/blkalloc/append_blk_allocator.cpp @@ -22,7 +22,7 @@ namespace homestore { AppendBlkAllocator::AppendBlkAllocator(const BlkAllocConfig& cfg, bool need_format, allocator_id_t id) : - BlkAllocator{cfg, id}, m_metrics{get_name().c_str()} { + BlkAllocator{cfg, id} { // TODO: try to make all append_blk_allocator instances use same client type to reduce metablk's cache footprint; meta_service().register_handler( get_name(), @@ -68,12 +68,12 @@ BlkAllocStatus AppendBlkAllocator::alloc_contiguous(BlkId& bid) { return alloc(1 // BlkAllocStatus AppendBlkAllocator::alloc(blk_count_t nblks, const blk_alloc_hints& hint, BlkId& out_bid) { if (available_blks() < nblks) { - COUNTER_INCREMENT(m_metrics, num_alloc_failure, 1); + //COUNTER_INCREMENT(m_metrics, num_alloc_failure, 1); LOGERROR("No space left to serve request nblks: {}, available_blks: {}", nblks, available_blks()); return BlkAllocStatus::SPACE_FULL; } else if (nblks > max_blks_per_blkid()) { // consumer(vdev) already handles this case. - COUNTER_INCREMENT(m_metrics, num_alloc_failure, 1); + //COUNTER_INCREMENT(m_metrics, num_alloc_failure, 1); LOGERROR("Can't serve request nblks: {} larger than max_blks_in_op: {}", nblks, max_blks_per_blkid()); return BlkAllocStatus::FAILED; } @@ -81,7 +81,7 @@ BlkAllocStatus AppendBlkAllocator::alloc(blk_count_t nblks, const blk_alloc_hint // Push 1 blk to the vector which has all the requested nblks; out_bid = BlkId{m_last_append_offset.fetch_add(nblks), nblks, m_chunk_id}; - COUNTER_INCREMENT(m_metrics, num_alloc, 1); + //COUNTER_INCREMENT(m_metrics, num_alloc, 1); return BlkAllocStatus::SUCCESS; } diff --git a/src/lib/blkalloc/append_blk_allocator.h b/src/lib/blkalloc/append_blk_allocator.h index 06713e4b5..ed256d7f1 100644 --- a/src/lib/blkalloc/append_blk_allocator.h +++ b/src/lib/blkalloc/append_blk_allocator.h @@ -38,21 +38,21 @@ struct append_blk_sb_t { }; #pragma pack() -class AppendBlkAllocMetrics : public sisl::MetricsGroup { -public: - explicit AppendBlkAllocMetrics(const char* inst_name) : sisl::MetricsGroup("AppendBlkAlloc", inst_name) { - REGISTER_COUNTER(num_alloc, "Number of blks alloc attempts"); - REGISTER_COUNTER(num_alloc_failure, "Number of blk alloc failures"); - - register_me_to_farm(); - } - - AppendBlkAllocMetrics(const AppendBlkAllocMetrics&) = delete; - AppendBlkAllocMetrics(AppendBlkAllocMetrics&&) noexcept = delete; - AppendBlkAllocMetrics& operator=(const AppendBlkAllocMetrics&) = delete; - AppendBlkAllocMetrics& operator=(AppendBlkAllocMetrics&&) noexcept = delete; - ~AppendBlkAllocMetrics() { deregister_me_from_farm(); } -}; +//class AppendBlkAllocMetrics : public sisl::MetricsGroup { +//public: +// explicit AppendBlkAllocMetrics(const char* inst_name) : sisl::MetricsGroup("AppendBlkAlloc", inst_name) { +// REGISTER_COUNTER(num_alloc, "Number of blks alloc attempts"); +// REGISTER_COUNTER(num_alloc_failure, "Number of blk alloc failures"); +// +// register_me_to_farm(); +// } +// +// AppendBlkAllocMetrics(const AppendBlkAllocMetrics&) = delete; +// AppendBlkAllocMetrics(AppendBlkAllocMetrics&&) noexcept = delete; +// AppendBlkAllocMetrics& operator=(const AppendBlkAllocMetrics&) = delete; +// AppendBlkAllocMetrics& operator=(AppendBlkAllocMetrics&&) noexcept = delete; +// ~AppendBlkAllocMetrics() { deregister_me_from_farm(); } +//}; // // The assumption for AppendBlkAllocator: @@ -121,7 +121,7 @@ class AppendBlkAllocator : public BlkAllocator { std::atomic< blk_num_t > m_freeable_nblks{0}; // count of blks fragmentedly freed (both on-disk and in-memory) std::atomic< blk_num_t > m_commit_offset{0}; // offset in on-disk version std::atomic< bool > m_is_dirty{false}; - AppendBlkAllocMetrics m_metrics; + //AppendBlkAllocMetrics m_metrics; superblk< append_blk_sb_t > m_sb; // only cp will be writing to this disk };