View Source recon_lib (recon v2.5.3)
Link to this section Summary
Functions
Takes a list of terms, and counts how often each of them appears in the list. The list returned is in no particular order.
Returns the attributes (
recon:inet_attrs()
) of all inet ports (UDP, SCTP, TCP) of the node.Returns the attributes required for a given inet port (UDP, SCTP, TCP). This form of attributes is standard for most comparison functions for processes in recon.
Returns a list of all the open ports in the VM, coupled with one of the properties desired from
erlang:port_info/1-2
.Returns a list of all the open ports in the VM, but only if the
Attr
's resulting value matches Val
. Attr
must be a property accepted by erlang:port_info/2
.Returns the attributes (
recon:proc_attrs()
) of all processes of the node, except the caller.Returns the attributes of a given process. This form of attributes is standard for most comparison functions for processes in recon.
Runs a fun once, waits
Ms
, runs the fun again, and returns both results.Diffs two runs of erlang:statistics(scheduler_wall_time) and returns usage metrics in terms of cores and 0..1 percentages.
Compare two samples and return a list based on some key. The type mentioned for the structure is
diff()
({Key,Val,Other}
), which is compatible with the recon:proc_attrs()
type.Returns the top n element of a list of process or inet attributes
Transforms a given term to a pid.
Transforms a given term to a port
Calls a given function every
Interval
milliseconds and supports a fold-like interface (each result is modified and accumulated)Calls a given function every
Interval
milliseconds and supports a map-like interface (each result is modified and returned)Equivalent of
pid(X,Y,Z)
in the Erlang shell.Link to this section Types
-type diff() :: [recon:proc_attrs() | recon:inet_attrs()].
Link to this section Functions
-spec count([term()]) -> [{term(), Count :: integer()}].
-spec inet_attrs(term()) -> [recon:inet_attrs()].
recon:inet_attrs()
) of all inet ports (UDP, SCTP, TCP) of the node.
-spec inet_attrs(AttributeName, port()) -> {ok, recon:inet_attrs()} | {error, term()} when AttributeName :: recv_cnt | recv_oct | send_cnt | send_oct | cnt | oct.
-spec port_list(Attr :: atom()) -> [{port(), term()}].
erlang:port_info/1-2
.
-spec port_list(Attr :: atom(), term()) -> [port()].
Attr
's resulting value matches Val
. Attr
must be a property accepted by erlang:port_info/2
.
-spec proc_attrs(term()) -> [recon:proc_attrs()].
recon:proc_attrs()
) of all processes of the node, except the caller.
-spec proc_attrs(term(), pid()) -> {ok, recon:proc_attrs()} | {error, term()}.
Returns the attributes of a given process. This form of attributes is standard for most comparison functions for processes in recon.
A special attribute isbinary_memory
, which will reduce the memory used by the process for binary data on the global heap.
-spec sample(Ms :: non_neg_integer(), fun(() -> term())) -> {First :: term(), Second :: term()}.
Ms
, runs the fun again, and returns both results.
-spec scheduler_usage_diff(SchedTime, SchedTime) -> undefined | [{SchedulerId, Usage}]
when
SchedTime :: [{SchedulerId, ActiveTime, TotalTime}],
SchedulerId :: pos_integer(),
Usage :: number(),
ActiveTime :: non_neg_integer(),
TotalTime :: non_neg_integer().
diff()
({Key,Val,Other}
), which is compatible with the recon:proc_attrs()
type.
-spec sublist_top_n_attrs([Attrs], pos_integer()) -> [Attrs] when Attrs :: recon:proc_attrs() | recon:inet_attrs().
-spec term_to_pid(recon:pid_term()) -> pid().
-spec term_to_port(recon:port_term()) -> port().
-spec time_fold(N, Interval, Fun, State, FoldFun, Init) -> [term()]
when
N :: non_neg_integer(),
Interval :: pos_integer(),
Fun :: fun((State) -> {term(), State}),
State :: term(),
FoldFun :: fun((term(), Init) -> Init),
Init :: term().
Interval
milliseconds and supports a fold-like interface (each result is modified and accumulated)
-spec time_map(N, Interval, Fun, State, MapFun) -> [term()]
when
N :: non_neg_integer(),
Interval :: pos_integer(),
Fun :: fun((State) -> {term(), State}),
State :: term(),
MapFun :: fun((_) -> term()).
Interval
milliseconds and supports a map-like interface (each result is modified and returned)
-spec triple_to_pid(N, N, N) -> pid() when N :: non_neg_integer().
pid(X,Y,Z)
in the Erlang shell.