Interpretation of Recon Tools

Source: Internet
Author: User

Recon is a tool released by Ferd for the production environment to diagnose erlang problems, not just the encapsulation of the Erlang Stdlib interface, but also the memory fragmentation related functions.

The following is a rencon of the various functions of interpretation, make a note

-Module(recon).-Export([Info/1, INFO/2, INFO/3, INFO/4, Proc_count/2, PROC_WINDOW/3, Bin_leak/1, Node_stats_print/2, NODE_STATS_LIST/2, NODE_STATS/4, Scheduler_usage/1]).-Export([GET_STATE/1, GET_STATE/2]).-Export([REMOTE_LOAD/1, REMOTE_LOAD/2, Source/1]).-Export([tcp/0, udp/0, sctp/0, files/0, port_types/0, Inet_count/2, INET_WINDOW/3, Port_info/1, PORT_INFO/2]).-Export([Rpc/1, RPC/2, RPC/3, Named_rpc/1, NAMED_RPC/2, NAMED_RPC/3]).
......
......

info/1,2,3,4 erlang:process_info Package, default print [meta, signals, location, memory_used, work] these parameters

info (pidterm, meta)-    info_type (pidterm, Meta, [Registered_name, Dictionary, Group_leader,                              - >    ,info_type (Pidterm, memory_used, [Memory, Message_queue_len,        Heap_size,                                         info_type (pidterm, work, [reductions]);

1 parameters are [PID], the default display 5 class as above, 2 parameters are [PID, type], and ERLANG:PROCESS_INFO/2, 3 parameters a,b,c 3 int, composed of <a.b.c>;4 parameters are a, B, C, type

PROC_COUNT/2 The first parameter type is Process_info_item () (option for ERLANG:PROCESS_INFO/2 second parameter) or binary_memory (used memory and),

The second parameter, N, is the number that prints the type value of the first n processes after sorting (from large to small) (the process running this command is not in the calculation )

PROC_WINDOW/3 First is type (IBID.), second is n (ibid.), 3rd is time (MS)

Represents the time period in which the type is worth changing to grow or decrease

BIN_LEAK/1 the first parameter is N, which represents the first n processes after ordering (the change in memory usage before and after the active GC)

NODE_STATS_PRINT/2 the first parameter is N, which indicates the number of times to print, the second is time (MS), indicates the print interval, and the content is printed as follows, mainly including the number of processes, memory, IO,GC times, Erlang Scheduler utilization (Scheduler thread busy not busy)

Stats = Fun({{oldin,oldout},{oldgcs,oldwords,_}, Schedwall})%%absolutesPROCC =Erlang:system_info (process_count), RunQ=Erlang:statistics (Run_queue), {_,logq}=Process_info (Whereis (Error_logger), Message_queue_len),%%Mem (absolutes)Mem =erlang:memory (), Tot=proplists:get_value (Total, Mem), procm=Proplists:get_value (PROCESSES_USED,MEM), Atom=Proplists:get_value (ATOM_USED,MEM), Bin=proplists:get_value (binary, Mem), Ets=Proplists:get_value (ETS, Mem),%%Incremental{{Input,in},{output,out}} =erlang:statistics (IO), GC={gcs,words,_} =Erlang:statistics (garbage_collection), Bytesin= in-Oldin, Bytesout= out-Oldout, Gccount= gcs-Oldgcs, Gcwords= words-Oldwords, {_, Reds}=Erlang:statistics (reductions), schedwallnew=Erlang:statistics (scheduler_wall_time), Schedusage=Recon_lib:scheduler_usage_diff (Schedwall, schedwallnew),%%Stats Results{{PROCESS_COUNT,PROCC}, {Run_queue,runq}, {error_logger_queue_len,logq}, {Memory_total,tot}, {memory_procs,procm}, {Memory_atoms,atom}, {Memory_bin,bin}, {memory_ets,ets}], [{Bytes_in,bytesin }, {bytes_out,bytesout}, {Gc_count,gccount}, {gc_words_reclaimed,gcwords}, {reductions,reds}, {Schedul Er_usage, Schedusage}]},%%New State{{in,out}, GC, schedwallnew}}End,

NODE_STATS_LIST/2, like the NODE_STATS_PRINT/2 function, prints each one and returns a list

NODE_STATS/4 the first 2 parameters and NODE_STATS_PRINT/2, the 3rd parameter is the fun function, the 4th Initial State ACC, which indicates that the fun function is used for each sample, and the result is a list of ACC (4 parameters).

SCHEDULER_USAGE/1, the parameter represents the time time, which represents the timing interval, and the Erlang Scheduler Utilization (Scheduler thread is busy) comparison is just the first step of NODE_STATS_PRINT/2.

(not to be continued)

Interpretation of Recon Tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.