chore: add pending_ops to disk stats (#3837)

This commit is contained in:
Roman Gershman 2024-10-01 09:51:53 +03:00 committed by GitHub
parent 79dc98dd03
commit 2d11a046be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -190,8 +190,9 @@ std::error_code DiskStorage::Stash(io::Bytes bytes, io::Bytes footer, StashCb cb
}
DiskStorage::Stats DiskStorage::GetStats() const {
return {alloc_.allocated_bytes(), alloc_.capacity(), heap_buf_alloc_cnt_, reg_buf_alloc_cnt_,
static_cast<size_t>(max_size_)};
return {
alloc_.allocated_bytes(), alloc_.capacity(), heap_buf_alloc_cnt_, reg_buf_alloc_cnt_,
static_cast<size_t>(max_size_), pending_ops_};
}
bool DiskStorage::CanGrow() const {

View file

@ -23,6 +23,7 @@ class DiskStorage {
uint64_t heap_buf_alloc_count = 0;
uint64_t registered_buf_alloc_count = 0;
size_t max_file_size = 0;
size_t pending_ops = 0;
};
using ReadCb = std::function<void(io::Result<std::string_view>)>;

View file

@ -27,7 +27,8 @@ ostream& operator<<(ostream& os, const OpManager::Stats& stats) {
<< ", capacity_bytes: " << stats.disk_stats.capacity_bytes
<< ", heap_buf_allocs: " << stats.disk_stats.heap_buf_alloc_count
<< ", registered_buf_allocs: " << stats.disk_stats.registered_buf_alloc_count
<< ", max_file_size: " << stats.disk_stats.max_file_size;
<< ", max_file_size: " << stats.disk_stats.max_file_size
<< ", pending_ops: " << stats.disk_stats.pending_ops;
}
struct OpManagerTest : PoolTestBase, OpManager {