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


##########
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:
   I added a new rexi top level test. It tests cast, pings, kills and covers 
the metrics gathering as well. It doesn't do streams though.
   
   ```
   Code Coverage:
   rexi            :  34%
   rexi_app        : 100%
   rexi_buffer     :  82%
   rexi_monitor    :   0%
   rexi_server     :  57%
   rexi_server_mon :  43%
   rexi_server_sup : 100%
   rexi_sup        : 100%
   rexi_utils      :  12%
   
   Total           : 44%
   ```
   
   <img width="569" alt="Screenshot 2024-07-23 at 11 18 20 PM" 
src="https://github.com/user-attachments/assets/c0baeb04-42f1-4f9b-972a-216fbf81c45f";>
   



-- 
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: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to