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 authored and Yuval-Ariel committed May 4, 2023
1 parent 1995c9e commit 05fc753
Show file tree
Hide file tree
Showing 2 changed files with 12 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 const Cache::CacheItemHelper *TEST_GetCacheItemHelperForRole();

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

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

Expand Down
10 changes: 10 additions & 0 deletions memtable/write_buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ 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 05fc753

Please sign in to comment.