You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "willholley (via GitHub)" <gi...@apache.org> on 2023/04/03 10:15:19 UTC

[GitHub] [couchdb] willholley commented on a diff in pull request #4507: feat: additional prometheus metrics

willholley commented on code in PR #4507:
URL: https://github.com/apache/couchdb/pull/4507#discussion_r1155763877


##########
src/couch_prometheus/src/couch_prometheus_server.erl:
##########
@@ -177,24 +200,27 @@ get_io_stats() ->
     ].
 
 get_message_queue_stats() ->
-    QLenFun = fun(Name) -> message_queue_len(whereis(Name)) end,
-    Queues = lists:map(QLenFun, registered()),
+    QFun = fun(Name) -> {Name, message_queue_len(whereis(Name))} end,
+    Queues = lists:map(QFun, registered()),
+    QueueLens = lists:map(fun({_, Len}) -> Len end, Queues),
+    QueueLenByLabel = lists:map(fun({Name, Len}) -> {[{queue_name, Name}], Len} end, Queues),

Review Comment:
   I think it's just wasted cycles to sort, yes



-- 
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-unsubscribe@couchdb.apache.org

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