Skip to content

Commit

Permalink
database: fix reads_memory_consumption for system semaphore
Browse files Browse the repository at this point in the history
The metric shows the opposite of what its name suggests.
It shows available memory rather than consumed memory.
Fix that.

Fixes #13810

Closes #13811

(cherry picked from commit 0813fa1)
  • Loading branch information
michoecho authored and denesb committed Dec 15, 2023
1 parent 0230798 commit 3af6dfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion replica/database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ database::setup_metrics() {
sm::description("Holds the number of currently active read operations from \"system\" keyspace tables. "),
{system_label_instance}),

sm::make_gauge("reads_memory_consumption", [this] { return max_memory_system_concurrent_reads() - _system_read_concurrency_sem.consumed_resources().memory; },
sm::make_gauge("reads_memory_consumption", [this] { return _system_read_concurrency_sem.consumed_resources().memory; },
sm::description("Holds the amount of memory consumed by all read operations from \"system\" keyspace tables. "),
{system_label_instance}),

Expand Down

0 comments on commit 3af6dfe

Please sign in to comment.