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 Dec 25, 2022
1 parent 2f46760 commit 9ae26fb
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 Cache::DeleterFn TEST_GetNoopDeleterForRole();

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 @@ -285,6 +285,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 9ae26fb

Please sign in to comment.