iilyak commented on code in PR #3985:
URL: https://github.com/apache/couchdb/pull/3985#discussion_r877459754


##########
src/couch/src/couch_debug.erl:
##########
@@ -335,6 +338,50 @@ help(print_tree) ->
           - TableSpec: List of either {Value} or {Width, Align, Value}
             where Align is either left/center/right.
 
+        ---
+    ", []);
+help(resource_hoggers) ->
+    io:format("
+        resource_hoggers(MemoryInfo, InfoKey)
+        --------------------------------
+
+        Prints the top processes hogging resources along with the value 
associated with InfoKey.
+          - MemoryInfo: Data map containing values for a set of InfoKeys
+            (same structure returned by memory_info)
+          - InfoKey: Desired key to obtain value for. The supported keys are
+            binary, dictionary, heap_size, links, memory, message_queue_len, 
monitored_by,
+            monitors, stack_size, and total_heap_size
+
+        ---
+    ", []);
+help(resource_hoggers_snapshot) ->
+    io:format("
+        resource_hoggers_snapshot(MemoryInfo)
+        resource_hoggers_snapshot(PreviousSnapshot)
+        --------------------------------
+
+        Prints a snapshot of the top processes hogging resources.
+          - MemoryInfo: Data map containing values for a set of InfoKeys
+            (same structure returned by memory_info)
+          - PreviousSnapshot: Previous snapshot of resource hoggers
+
+        An example workflow is to call `memory_info(Pids)` and pass this into 
`resource_hoggers_snapshot/1` along 
+        with the optional number of snapshots to take, N, and InfoKeys.
+
+        ---
+    ", []);
+help(analyze_resource_hoggers) ->
+    io:format("
+        analyze_resource_hoggers(Snapshot, TopN)
+        --------------------------------
+
+        Analyzes the TopN processes hogging resources along with the values 
associated with InfoKeys.
+          - Snapshot: Snapshot of resource hoggers
+          - TopN: Number of top processes to analyze
+
+        An example workflow is to call 
`resource_hoggers_snapshot(memory_info(Pids))` and pass this to 
`analyze_resource_hoggers/2`
+        along with the number of top processes to analyze, TopN.

Review Comment:
   Maybe add reference to example workflow documented in 
`resource_hoggers_snapshot`.
   
   ```
   See `couch_debug:help(resource_hoggers_snapshot)` for example and more info.
   ```



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