good first issuetype/enhancement
描述
Enhancement
Currently the log is like
[expensivequery.go:145] ["memory exceeds quota"] [cost_time=51.568008934s] [cop_time=0.00379198s] [process_time=10.266095428s] [wait_time=0.015905714s] [request_count=306] [total_keys=8390160] [process_keys=8389899] [num_cop_tasks=306] [process_avg_time=0.033549331s] [process_p90_time=0.049799413s] [process_max_time=0.189071799s] [process_max_addr=192.168.31.244:20160] [wait_avg_time=0.000051979s] [wait_p90_time=0.00006339s] [wait_max_time=0.00060825s] [wait_max_addr=192.168.31.244:20160] [stats=t:448984970558963713] [conn=3034578948] [user=root] [database=test] [table_ids="[104]"] [txn_start_ts=448984988922413057] [mem_max="1079848924 Bytes (1.01 GB)"] [sql="insert into t select * from t"] [session_alias=] ["affected rows"=9586902]
It tells us the memory usage, but we have no idea which components contribute the most to it. A simple improvement can be search all sub-trackers that contribute more than 10% of the usage, and print their labels and actual usages in the log.