system_info模块

在看了 Erlang新增全面的系统信息收集器-system_information模块之后,自己下载最新的代码,查看该模块,仔细看了一下
report() -> [
	{init_arguments,    init:get_arguments()},
	{code_paths,        code:get_path()},
	{code,              code()},
	{system_info,       erlang_system_info()},
	{erts_compile_info, erlang:system_info(compile_info)},
	{beam_dynamic_libraries, get_dynamic_libraries()},
	{environment_erts,  os_getenv_erts_specific()},
	{environment,       [split_env(Env) || Env <- os:getenv()]}
    ].

[list]
  • {init_arguments,    init:get_arguments()},对应的是vm的启动参数,详细信息参考文档中的erts中的init模块。
  • {code_paths,        code:get_path()},对应的是加载到vm中模块的路径
  • {code,              code()},对应的是加载路径内相应代码的详细信息:
  • 当路径是一个application的路径时,对应的信息是:
    {application,
        {AppName, [
    		    {description, proplists:get_value(description, Info, [])},
    		    {vsn,         proplists:get_value(vsn, Info, [])},
    		    {path,        Path},
    		    {modules,     [
                                       {Mod, [
                                               {loaded,   Loaded},
                                               {native,   beam_is_native_compiled(Beam)},
                                               {compiler, get_compiler_version(Beam)},
                                               {md5,      hexstring(Md5)}
                                              ]}]}]}}
  • {system_info,       erlang_system_info()},对应的是调用erlang:system_info(Ele)获得信息列表,其中Ele组成的列表是:
  • [
    	    allocator,
    	    check_io,
    	    otp_release,
    	    port_limit,
    	    process_limit,
    	    % procs,  % not needed
    	    smp_support,
    	    system_version,
    	    system_architecture,
    	    threads,
    	    thread_pool_size,
    	    {wordsize,internal},
    	    {wordsize,external},
    	    {cpu_topology, defined},
    	    {cpu_topology, detected},
    	    scheduler_bind_type,
    	    scheduler_bindings,
    	    compat_rel,
    	    schedulers_state,
    	    build_type,
    	    logical_processors,
    	    logical_processors_online,
    	    logical_processors_available,
    	    driver_version,
    	    emu_args,
    	    ethread_info,
    	    beam_jump_table,
    	    taints
    	]
    
  • {erts_compile_info, erlang:system_info(compile_info)},对应的信息参考erlang模块
  • {beam_dynamic_libraries, get_dynamic_libraries()},对应的是:vm依赖的动态库情况
  • {environment_erts,  os_getenv_erts_specific()},对应的是:erts运行的环境变量
  • {environment,       [split_env(Env) || Env <- os:getenv()]},对应的是所有的系统环境变量
  • [/list]

    你可能感兴趣的:(erlang)