nickva commented on a change in pull request #761: Add a debugging utilities
for listing processes
URL: https://github.com/apache/couchdb/pull/761#discussion_r134800829
##########
File path: src/couch/src/couch_debug.erl
##########
@@ -13,11 +13,195 @@
-module(couch_debug).
-export([
+ help/0,
+ help/1
+]).
+
+-export([
opened_files/0,
opened_files_by_regexp/1,
opened_files_contains/1
]).
+-export([
+ process_name/1,
+ link_tree/1,
+ link_tree/2,
+ mapfold_tree/3,
+ map_tree/2,
+ fold_tree/3,
+ linked_processes_info/2,
+ print_linked_processes/1
+]).
+
+help() ->
+ [
+ opened_files,
+ opened_files_by_regexp,
+ opened_files_contains,
+ process_name,
+ link_tree,
+ mapfold,
+ map,
+ fold,
+ linked_processes_info,
+ print_linked_processes,
+ ps
+ ].
+
+-spec help(Function :: atom()) -> ok.
+help(opened_files) ->
+ io:format("
+ opened_files()
+ --------------
+
+ Returns list of currently opened files
+ It iterates through erlang:ports and filter out all ports which are not
efile.
+ It uses `process_info(Pid, dictionary)` to get info about couch_file
properties.
+ ---
+ ", []);
+help(opened_files_by_regexp) ->
+ io:format("
+ opened_files_by_regexp(FileRegExp)
+ ----------------------------------
+
+ Returns list of currently opened files which name matches provided regular
expression.
+ It iterates through `erlang:ports()` and filter out all ports which are
not efile.
+ It uses `process_info(Pid, dictionary)` to get info about couch_file
properties.
+ ---
+ ", []);
+help(opened_files_contains) ->
+ io:format("
+ opened_files_contains(SubString)
+ --------------------------------
+
+ Returns list of currently opened files which name contains provided
SubString.
Review comment:
whose names contain the provided...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services