aegis toplevel的进程图
使用dot画图可以使你一遍阅读代码一遍讨论一遍把关系图给画出来了,很赞。
3个子系统
第一个子系统 - rds_proxy_sup的启动顺序
各个图对应的代码
toplevel的gv代码
digraph G { //rankdir=LR; edge [arrowsize= .5] node [fontsize = 11, height = .02, style=filled, color=black, fillcolor=greenyellow] aegis_sup -> rds_proxy_sup; aegis_sup -> aegis_public_sup; aegis_sup -> rds_api_sup; aegis_sup [shape = doublecircle, color = red] {rank = same; rds_proxy_sup; aegis_public_sup; rds_api_sup; } }
rds_proxy_sup 子进程启动顺序的gv代码
digraph G { edge [arrowsize= .5] node [fontsize = 11, height = .02, style=filled, color=black, fillcolor=greenyellow] aegis_sup -> rds_proxy_sup; aegis_sup -> aegis_public_sup; aegis_sup -> rds_api_sup; rank = same; rds_proxy_sup; aegis_public_sup; rds_api_sup; } rds_proxy_sup -> rds_proxy_session_sup; rds_proxy_sup -> rds_proxy_acceptor_manager_sup; rds_proxy_sup -> rds_proxy_manager_sup; rds_proxy_sup -> rds_proxy_monitor_sup; rds_proxy_sup -> rds_proxy_partition_sup; rds_proxy_sup -> rds_proxy_mem_monitor; rds_proxy_sup -> rds_proxy_downgrade_task; {rank = same; rds_proxy_session_sup; rds_proxy_acceptor_manager_sup; rds_proxy_manager_sup; rds_proxy_monitor_sup; rds_proxy_partition_sup; rds_proxy_mem_monitor; rds_proxy_downgrade_task } // acceptor rds_proxy_acceptor_manager_sup -> rds_proxy_listen; rds_proxy_acceptor_manager_sup -> rds_proxy_heart_acceptor_sup; rds_proxy_acceptor_manager_sup -> rds_proxy_acceptors_sup; {rank = same; rds_proxy_listen; rds_proxy_heart_acceptor_sup; rds_proxy_acceptors_sup; } rds_proxy_acceptors_sup -> rds_proxy_acceptor_NbAcceptors; rds_proxy_acceptor_NbAcceptors -> rds_proxy_listen [label = get_listen, style=dashed, color=blue]; rds_proxy_acceptor_NbAcceptors -> rds_proxy_session [label = start, style=dashed, color=blue]; // session sup rds_proxy_session_sup -> rds_mysql_session_sup00_16; rds_proxy_session_sup -> rds_mysql_backend_sup00_16; rds_proxy_session_sup -> rds_mysql_simple_session_sup00_16; rds_proxy_session_sup -> rds_mssql_session_sup00_16; {rank = same; rds_mysql_session_sup00_16; rds_mysql_backend_sup00_16; rds_mysql_simple_session_sup00_16; rds_mssql_session_sup00_16; } rds_mysql_session_sup00_16 -> rds_mysql_session; rds_mssql_session_sup00_16 -> rds_mssql_session; rds_mysql_backend_sup00_16 -> rds_mysql_backend; rds_mysql_session -> rds_mysql_backend_sup00_16 [label = "call start_child", style=dashed, color=blue]; rds_proxy_manager_sup -> rds_proxy_connections_pool; rds_proxy_manager_sup -> rds_proxy_metastore_cache; rds_proxy_manager_sup -> rds_proxy_ips_pool_checker; rds_proxy_manager_sup -> rds_proxy_switcher_checker; rds_proxy_manager_sup -> rds_proxy_switcher_server; rds_proxy_manager_sup -> rds_proxy_flow_reduce; rds_proxy_manager_sup -> rds_proxy_netflow; rds_proxy_manager_sup -> rds_proxy_crontab_sup; rds_proxy_mem_monitor [shape = box, fillcolor = yellow]; rds_proxy_downgrade_task [shape = box, fillcolor = yellow]; rds_proxy_listen [shape = box, fillcolor = yellow]; rds_proxy_connections_pool [shape = box, fillcolor = yellow]; rds_proxy_metastore_cache [shape = box, fillcolor = yellow]; rds_proxy_ips_pool_checker [shape = box, fillcolor = yellow]; rds_proxy_switcher_server [shape = box, fillcolor = yellow]; rds_proxy_switcher_checker [shape = box, fillcolor = yellow]; rds_proxy_flow_reduce [shape = box, fillcolor = yellow]; rds_proxy_netflow [shape = box, fillcolor = yellow]; rds_proxy_acceptor_NbAcceptors [shape = box, fillcolor = yellow]; rds_mssql_session [shape = box, fillcolor = green]; rds_mysql_backend [shape = box, fillcolor = green]; rds_mysql_session [shape = box, fillcolor = green]; }