Skip to content

Commit

Permalink
Print WBM's cache info to log (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
udi-speedb committed Dec 25, 2022
1 parent a2c3d50 commit 717f26e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cache/cache_reservation_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ class CacheReservationManagerImpl
// test are from the same translation units
static Cache::DeleterFn TEST_GetNoopDeleterForRole();

const Cache* TEST_GetCache() const { return cache_.get(); }

private:
static constexpr std::size_t kSizeDummyEntry = 256 * 1024;

Expand Down
7 changes: 7 additions & 0 deletions memtable/write_buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ std::string WriteBufferManager::GetPrintableOptions() const {
"wbm.size", buffer_size());
ret.append(buffer);

const Cache* cache = nullptr;
if (cache_res_mgr_ != nullptr) {
cache = static_cast<CacheReservationManagerImpl<CacheEntryRole::kWriteBuffer>*>(cache_res_mgr_.get())->TEST_GetCache();
}
snprintf(buffer, kBufferSize, "%*s: %p\n", field_width, "wbm.cache", cache);
ret.append(buffer);

snprintf(buffer, kBufferSize, "%*s: %d\n", field_width, "wbm.allow_stalls",
allow_stall_);
ret.append(buffer);
Expand Down

0 comments on commit 717f26e

Please sign in to comment.