commitlog: Add counters for actual pending allocations + segment wait

Fixes #9367

The CL counters pending_allocations and requests_blocked_memory are
exposed in graphana (etc) and often referred to as metrics on whether
we are blocking on commit log. But they don't really show this, as
they only measure whether or not we are blocked on the memory bandwidth
semaphore that provides rate back pressure (fixed num bytes/s - sortof).

However, actual tasks in allocation or segment wait is not exposed, so
if we are blocked on disk IO or waiting for segments to become available,
we have no visible metrics.

While the "old" counters certainly are valid, I have yet to ever see them
be non-zero in modern life.

Closes #9368
This commit is contained in:
Calle Wilund
2021-09-21 08:20:30 +00:00
committed by Botond Dénes
parent e22364dcc5
commit 688fd31e64
3 changed files with 49 additions and 3 deletions

View File

@@ -290,6 +290,10 @@ public:
uint64_t get_flush_limit_exceeded_count() const;
uint64_t get_num_segments_created() const;
uint64_t get_num_segments_destroyed() const;
uint64_t get_num_blocked_on_new_segment() const;
uint64_t get_num_active_allocations() const;
/**
* Get number of inactive (finished), segments lingering
* due to still being dirty