nickva commented on code in PR #5150:
URL: https://github.com/apache/couchdb/pull/5150#discussion_r1688997847


##########
src/rexi/src/rexi_server_mon.erl:
##########
@@ -43,6 +43,14 @@ start_link(ChildMod) ->
 status() ->
     gen_server:call(?MODULE, status).
 
+aggregate_queue_len(rexi_buffer) ->
+    % rexi_buffer acts as an explicit message queue. In order to get useful
+    % metrics from it we really need to add both its process' message queue and
+    % already buffered messages.
+    ServerIds = server_ids(rexi_buffer),
+    MQLengths = [message_queue_len(ServerId) || ServerId <- ServerIds],
+    BufLengths = [rexi_buffer:get_buffered_count(ServerId) || ServerId <- 
ServerIds],
+    lists:sum(MQLengths) + lists:sum(BufLengths);

Review Comment:
   Oh good point. That should be covered by the chttpd `/_system` test but now 
that we have some actual rexi tests it doesn't hurt to cover these in the rexi 
app as well. I'll add some tests for it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to