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 scylladb#13810
  • Loading branch information
michoecho committed May 8, 2023
1 parent 113fb32 commit c3619e3
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 @@ -670,7 +670,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 c3619e3

Please sign in to comment.