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


##########
src/chttpd/src/chttpd_node.erl:
##########
@@ -405,18 +405,29 @@ get_distribution_stats() ->
 message_queues() ->
     MessageQueuesAgg = [
         {couch_server, couch_server:aggregate_queue_len()},
-        {index_server, couch_index_server:aggregate_queue_len()}
+        {index_server, couch_index_server:aggregate_queue_len()},
+        {rexi_server, rexi:aggregate_server_queue_len()},
+        {rexi_buffer, rexi:aggregate_buffer_queue_len()}
     ],
-    MessageQueuesReg = lists:map(
-        fun(Name) ->
-            Type = message_queue_len,
-            {Type, Length} = process_info(whereis(Name), Type),
-            {Name, Length}
-        end,
-        registered()
-    ),
+    MessageQueuesReg = lists:filtermap(fun message_queue/1, registered()),
     MessageQueuesAgg ++ MessageQueuesReg.
 
+message_queue(rexi_server) ->
+    % Compatibility clause. Remove in 3.4+ version when singleton
+    % rexi_server is removed.
+    false;
+message_queue(Name) ->
+    Pid = whereis(Name),
+    case is_pid(Pid) of
+        true ->
+            case process_info(Pid, message_queue_len) of
+                {message_queue_len, Length} -> {true, {Name, Length}};
+                _ -> false

Review Comment:
   agree, let's go with tighter matching, I was being too defensive but the 
response types are well specified here as `undefined`



-- 
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