Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: add two columns (#5709)

Liu Jia885a5f8de6f
diff --git a/frontend/src/components/SlowQuery/Panel/LogTable.vue b/frontend/src/components/SlowQuery/Panel/LogTable.vue
index 306f749860..d803646f72 100644
--- a/frontend/src/components/SlowQuery/Panel/LogTable.vue
+++ b/frontend/src/components/SlowQuery/Panel/LogTable.vue
@@ -29,12 +29,18 @@
<div class="bb-grid-cell">
{{ item.log.statistics.count }}
</div>
+ <div class="bb-grid-cell">
+ {{ (item.log.statistics.countPercent * 100).toFixed(2) }}%
+ </div>
<div class="bb-grid-cell">
{{ durationText(item.log.statistics.maximumQueryTime) }}
</div>
<div class="bb-grid-cell">
{{ durationText(item.log.statistics.averageQueryTime) }}
</div>
+ <div class="bb-grid-cell">
+ {{ (item.log.statistics.queryTimePercent * 100).toFixed(2) }}%
+ </div>
<div class="bb-grid-cell">
{{
instanceHasSlowQueryDetail(item.database.instance)
@@ -146,6 +152,10 @@ const columns = computed(() => {
title: t("slow-query.total-query-count"),
width: "minmax(6rem, auto)",
},
+ {
+ title: t("slow-query.query-count-percent"),
+ width: "minmax(6rem, auto)",
+ },
{
title: t("slow-query.max-query-time"),
width: "minmax(6rem, auto)",
@@ -154,6 +164,10 @@ const columns = computed(() => {
title: t("slow-query.avg-query-time"),
width: "minmax(6rem, auto)",
},
+ {
+ title: t("slow-query.query-time-percent"),
+ width: "minmax(6rem, auto)",
+ },
{
title: t("slow-query.max-rows-examined"),
width: "minmax(6rem, auto)",
@@ -208,9 +222,9 @@ const toggleExpandRow = (item: ComposedSlowQueryLog) => {
const durationText = (duration: Duration | undefined) => {
if (!duration) return "-";
- const nanos = duration.nanos;
- if (!nanos) return "0";
- return (nanos / 1e9).toFixed(6);
+ const { seconds, nanos } = duration;
+ const total = seconds + nanos / 1e9;
+ return total.toFixed(6);
};
watch(
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index c0ee393d6b..bee2d5b876 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2315,8 +2315,10 @@
"database-name": "Database name",
"sql-statement": "SQL statement",
"total-query-count": "Total query count",
+ "query-count-percent": "Query count %",
"max-query-time": "Max query time",
"avg-query-time": "Avg query time",
+ "query-time-percent": "Query time %",
"max-rows-examined": "Max rows examined",
"avg-rows-examined": "Avg rows examined",
"max-rows-sent": "Max rows sent",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index a5c04a4213..59000f43b3 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2312,8 +2312,10 @@
"database-name": "数据库名",
"sql-statement": "SQL 语句",
"total-query-count": "总执行次数",
+ "query-count-percent": "执行次数比例",
"max-query-time": "最大执行时长",
"avg-query-time": "平均执行时长",
+ "query-time-percent": "执行时长比例",
"max-rows-examined": "最大扫描行数",
"avg-rows-examined": "平均扫描行数",
"max-rows-sent": "最大返回行数",