diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2019-03-28 19:07:40 +0000 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2019-03-28 19:07:40 +0000 |
| commit | 74aac975655b4d419ac53c911768048234edbb9a (patch) | |
| tree | e63a2f84cf7689e20873c2eef7a4eed2dc94b7bd /src | |
| parent | 99c5828455973c6a719a982aa453e4f946bc3f64 (diff) | |
| download | rabbitmq-server-git-74aac975655b4d419ac53c911768048234edbb9a.tar.gz | |
Publish in memory stats
Uses the existing `messages_ram` and `message_bytes_ram` stats
[#164735591]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_quorum_queue.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl index b640e04ed4..b11a40cead 100644 --- a/src/rabbit_quorum_queue.erl +++ b/src/rabbit_quorum_queue.erl @@ -61,7 +61,9 @@ members, open_files, single_active_consumer_pid, - single_active_consumer_ctag + single_active_consumer_ctag, + messages_ram, + message_bytes_ram ]). -define(RPC_TIMEOUT, 1000). @@ -973,6 +975,16 @@ i(single_active_consumer_ctag, Q) when ?is_amqqueue(Q) -> '' end; i(type, _) -> quorum; +i(messages_ram, Q) when ?is_amqqueue(Q) -> + QPid = amqqueue:get_pid(Q), + {ok, {_, {Length, _}}, _} = ra:local_query(QPid, + fun rabbit_fifo:query_in_memory_usage/1), + Length; +i(message_bytes_ram, Q) when ?is_amqqueue(Q) -> + QPid = amqqueue:get_pid(Q), + {ok, {_, {_, Bytes}}, _} = ra:local_query(QPid, + fun rabbit_fifo:query_in_memory_usage/1), + Bytes; i(_K, _Q) -> ''. open_files(Name) -> |
