-
-
Save binarytemple/76dea8c05dd4871cc823297e3f6e92bd to your computer and use it in GitHub Desktop.
Get Info and Status by Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GetInfoAndStatusByModule = fun (Module) -> | |
IsProcessInModule = fun (Module, ProcessInfo) -> | |
case proc_lib:translate_initial_call(ProcessInfo) of | |
{ICMod, _ICFun, _ICArity} when Module =:= ICMod -> true; | |
_ -> false | |
end | |
end, | |
ProcessTable = erlang:processes(), | |
CurriedPredicate = fun (P) -> IsProcessInModule(Module, P) end, | |
Pids = lists:filter(CurriedPredicate, ProcessTable), | |
[{erlang:process_info(P), sys:get_status(P)} || P <- Pids] | |
end. | |
rp(GetInfoAndStatusByModule(riak_cs_gc_d)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment