From 51e406c4cbd6bd29d50dda52d5bb8fdc36a0470b Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Thu, 26 Nov 2020 18:22:51 +0800 Subject: [PATCH] slowlog: Improve descriptions (#817) Signed-off-by: Breezewish --- .../SlowQuery/pages/Detail/DetailTabTime.tsx | 36 +++++++++---------- ui/lib/apps/SlowQuery/translations/en.yaml | 14 ++++---- ui/lib/apps/SlowQuery/translations/zh.yaml | 22 ++++++------ ui/lib/utils/tableColumns.tsx | 7 +++- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index 07c68758da..c6673b3c27 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -41,10 +41,6 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'optimize_time', value: data.optimize_time! * 10e8, }, - { - key: 'wait_ts', - value: data.wait_ts! * 10e8, - }, { key: 'cop_time', value: data.cop_time! * 10e8, @@ -58,36 +54,36 @@ export default function TabBasic({ data }: ITabTimeProps) { value: data.process_time! * 10e8, }, { - key: 'lock_keys_time', - value: data.lock_keys_time! * 10e8, - }, - { - key: 'backoff_time', - value: data.backoff_time! * 10e8, + key: 'local_latch_wait_time', + value: data.local_latch_wait_time! * 10e8, }, { - key: 'prewrite_time', - value: data.prewrite_time! * 10e8, + key: 'lock_keys_time', + value: data.lock_keys_time! * 10e8, }, { - key: 'local_latch_wait_time', - value: data.local_latch_wait_time! * 10e8, + key: 'resolve_lock_time', + value: data.resolve_lock_time! * 10e8, }, { - key: 'wait_prewrite_binlog_time', - value: data.wait_prewrite_binlog_time! * 10e8, + key: 'wait_ts', + value: data.wait_ts! * 10e8, }, { key: 'get_commit_ts_time', value: data.get_commit_ts_time! * 10e8, }, + { + key: 'prewrite_time', + value: data.prewrite_time! * 10e8, + }, { key: 'commit_time', value: data.commit_time! * 10e8, }, { - key: 'resolve_lock_time', - value: data.resolve_lock_time! * 10e8, + key: 'backoff_time', + value: data.backoff_time! * 10e8, }, { key: 'commit_backoff_time', @@ -101,6 +97,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'write_sql_response_total', value: data.write_sql_response_total! * 10e8, }, + { + key: 'wait_prewrite_binlog_time', + value: data.wait_prewrite_binlog_time! * 10e8, + }, ] const columns = timeValueColumns('slow_query.fields.', items) return ( diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index e6b37792dd..e904a49c40 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -44,15 +44,15 @@ slow_query: preproc_subqueries_time_tooltip: Time consumed when pre-processing the subquery during the rewrite plan phase optimize_time:     Optimize Plan Time wait_ts:   Get Start Ts Time - wait_ts_tooltip: Time consumed of retrieving the transaction start timestamp when transaction begins + wait_ts_tooltip: Time consumed when getting a start timestamp when transaction begins cop_time:   Coprocessor Executor Time cop_time_tooltip: 'The elapsed wall time when TiDB Coprocessor executor waiting all Coprocessor requests to finish (note: when there are JOIN in SQL statement, multiple TiDB Coprocessor executors may be running in parallel, which may cause this time not being a wall time)' wait_time:     Coprocessor Wait Time - wait_time_tooltip: The total waiting time of Coprocessor request in TiKV + wait_time_tooltip: 'The total time of Coprocessor request is prepared and wait to execute in TiKV, which may happen when retrieving a snapshot though Raft concensus protocol (note: TiKV waits requests in parallel so that this is not a wall time)' process_time:     Coprocessor Process Time process_time_tooltip: 'The total time of Coprocessor request being executed in TiKV (note: TiKV executes requests in parallel so that this is not a wall time)' - backoff_time:   Backoff Retry Time - backoff_time_tooltip: 'The total waiting time before retry when a query encounters errors and requires a retry (note: there may be multiple backoff running in parallel so that this may not be a wall time)' + backoff_time:   Execution Backoff Time + backoff_time_tooltip: 'The total backoff waiting time before retry when a query encounters errors (note: there may be multiple backoffs in parallel so that this may not be a wall time)' lock_keys_time:   Lock Keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time @@ -68,11 +68,11 @@ slow_query: commit_time:   Commit Time commit_time_tooltip: Time consumed in 2PC commit phase when transaction commits commit_backoff_time:   Commit Backoff Time - commit_backoff_time_tooltip: Total backoff waiting time when 2PC commit encounters errors when transaction commits + commit_backoff_time_tooltip: 'The total backoff waiting time when 2PC commit encounters errors (note: there may be multiple backoffs in parallel so that this may not be a wall time)' write_sql_response_total:   Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the SQL client - exec_retry_time:   Retry execution Time - exec_retry_time_tooltip: Time consumed when retrying the SQL statement execution caused by locks or errors + exec_retry_time:   Retried execution Time + exec_retry_time_tooltip: Wall time consumed when SQL statement is retried and executed again, except for the last exection request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index d5c46b20df..e6d1bc030d 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -50,18 +50,18 @@ slow_query: cop_time:   Coprocessor 执行耗时 cop_time_tooltip: TiDB Coprocessor 算子等待所有任务在 TiKV 上并行执行完毕耗费的自然时间(注:当 SQL 语句中包含 JOIN 时,多个 TiDB Coprocessor 算子可能会并行执行,此时不再等同于自然时间) wait_time:     Coprocessor 累计等待耗时 - wait_time_tooltip: TiKV 准备并等待 Coprocessor 任务执行的累计时间 + wait_time_tooltip: TiKV 准备并等待 Coprocessor 任务执行的累计时间,等待过程中包括通过 Raft 一致性协议取快照等(注:TiKV 会并行等待任务,因此该时间不是自然流逝时间) process_time:     Coprocessor 累计执行耗时 - process_time_tooltip: TiKV 执行 Coprocessor 任务的累计处理时间(注:TiKV 会并行处理请求,该时间不是自然流逝时间) + process_time_tooltip: TiKV 执行 Coprocessor 任务的累计处理时间(注:TiKV 会并行处理任务,因此该时间不是自然流逝时间) lock_keys_time:   上锁耗时 lock_keys_time_tooltip: 悲观事务中对相关行数据进行上锁的耗时 - backoff_time:   累计重试等待耗时 - backoff_time_tooltip: 执行过程中遇到锁或者错误后的累计等待耗时(注:可能同时存在多个重试等待,因此该时间可能不是自然流逝时间) + backoff_time:   执行阶段累计 Backoff 耗时 + backoff_time_tooltip: 在执行失败时,Backoff 机制等待一段时间再重试时的 Backoff 累计耗时(注:可能同时存在多个 Backoff,因此该时间可能不是自然流逝时间) get_commit_ts_time:   取事务 Commit Ts 耗时 get_commit_ts_time_tooltip: 从 PD 取提交时间戳(事务号)步骤的耗时 - local_latch_wait_time:   Local Latch Wait 耗时 + local_latch_wait_time:   TiDB 本地等锁耗时 local_latch_wait_time_tooltip: 事务在 TiDB 本地与其他事务产生了锁冲突并等待的耗时 - resolve_lock_time:   Resolve Lock 耗时 + resolve_lock_time:   解锁耗时 resolve_lock_time_tooltip: 事务在提交过程中与其他事务产生了锁冲突并处理锁冲突的耗时 prewrite_time:   Prewrite 阶段耗时 prewrite_time_tooltip: 事务两阶段提交中第一阶段(prewrite 阶段)的耗时 @@ -69,12 +69,12 @@ slow_query: wait_prewrite_binlog_time_tooltip: 等待 Binlog Prewrite 完成的耗时 commit_time:   Commit 阶段耗时 commit_time_tooltip: 事务两阶段提交中第二阶段(commit 阶段)的耗时 - commit_backoff_time:   Commit 重试等待耗时 - commit_backoff_time_tooltip: 事务两阶段提交过程中遇到锁或者错误后的等待耗时 + commit_backoff_time:   Commit 阶段累计 Backoff 耗时 + commit_backoff_time_tooltip: 事务递交失败时,Backoff 机制等待一段时间再重试时的 Backoff 累计耗时(注:可能同时存在多个 Backoff,因此该时间可能不是自然流逝时间) write_sql_response_total:   发送结果耗时 - write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 - exec_retry_time:   执行重试耗时 - exec_retry_time_tooltip: 由于锁冲突或者某些错误导致执行失败的执行耗时 + write_sql_response_total_tooltip: 发送 SQL 语句执行结果给客户端的耗时 + exec_retry_time:   前序执行耗时 + exec_retry_time_tooltip: 由于锁冲突或错误,计划可能会执行失败并重试执行多次,该时间是不包含最后一次执行的前序执行自然时间(注:执行计划中的时间不含该前序时间) request_count: Coprocessor 请求数 process_keys: 可见版本数 diff --git a/ui/lib/utils/tableColumns.tsx b/ui/lib/utils/tableColumns.tsx index b37a7479dc..3b41590e80 100644 --- a/ui/lib/utils/tableColumns.tsx +++ b/ui/lib/utils/tableColumns.tsx @@ -133,12 +133,17 @@ function fieldsDescriptionColumn(transKeyPrefix: string): IColumn { minWidth: 150, maxWidth: 300, onRender: (rec) => { - return ( + const content = ( ) + return ( + + {content} + + ) }, } }