Add timedetail statistics information for cop tasks in slow log
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
The slow log doesn't record `timedetail` stats for cop task, such as below.
`time:184.9ms, loops:89, cop_task: {num: 1, max: 184.2ms, proc_keys: 90000, tot_proc: 142ms, rpc_num: 1, rpc_time: 184.1ms, copr_cache_hit_ratio: 0.00, distsql_concurrency: 15}`
`tikv_task:{time:92ms, loops:92}, scan_detail: {total_process_keys: 90000, total_process_keys_size: 20159156, total_keys: 90001, get_snapshot_time: 31.5µs, rocksdb: {key_skipped_count: 90000, block: {cache_hit_count: 332}}}`
We should add time detail for root tasks and cop tasks in order to enhance the ease of use of slow logs, such as bellow.
`time:190.7ms, loops:89, cop_task: {num: 1, max: 190.1ms, proc_keys: 90000, tot_proc: 146ms, **tot_wall: 146.8ms**, rpc_num: 1, rpc_time: 190.1ms, copr_cache_hit_ratio: 0.00, distsql_concurrency: 15}`
`tikv_task:{time:85ms, loops:92}, **total_process_time**: 134ms, **tikv_wall_time**: 135ms, scan_detail: {total_process_keys: 180000, total_process_keys_size: 40318312, total_keys: 180002, get_snapshot_time: 61µs, rocksdb: {key_skipped_count: 180000, block: {cache_hit_count: 664}}}`
Contributor guide
Assessment
This issue has not been assessed yet.