Skip to content

Commit

Permalink
issue: 3928453 Print "in use" buffers in the buffer pool statistics
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Podgornyi <dmytrop@nvidia.com>
  • Loading branch information
pasis committed Jun 13, 2024
1 parent 3ed2c3d commit 485faeb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/dev/buffer_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ bool buffer_pool::expand(size_t count)
}
}
m_n_buffers_created += count;
m_p_bpool_stat->n_buffer_pool_created = m_n_buffers_created;
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/core/util/xlio_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ typedef struct {
uint32_t n_buffer_pool_size;
uint32_t n_buffer_pool_no_bufs;
uint32_t n_buffer_pool_expands;
uint32_t n_buffer_pool_created;
} bpool_stats_t;

typedef struct {
Expand Down
2 changes: 2 additions & 0 deletions src/stats/stats_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ void print_bpool_stats(bpool_instance_block_t *p_bpool_inst_arr)
printf("\tBUFFER_POOL=[%u]\n", i);
}
printf(FORMAT_STATS_32bit, "Size:", p_bpool_stats->n_buffer_pool_size);
printf(FORMAT_STATS_32bit, "Buffers in use:",
p_bpool_stats->n_buffer_pool_created - p_bpool_stats->n_buffer_pool_size);
printf(FORMAT_STATS_32bit, "No buffers error:", p_bpool_stats->n_buffer_pool_no_bufs);
if (p_bpool_stats->n_buffer_pool_expands) {
printf(FORMAT_STATS_32bit, "Expands:", p_bpool_stats->n_buffer_pool_expands);
Expand Down

0 comments on commit 485faeb

Please sign in to comment.