Skip to content

Commit a5f5140

Browse files
authored
feat(Query): add explanation to query duration (#501)
1 parent de3d540 commit a5f5140

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

src/containers/Tenant/Query/QueryDuration/QueryDuration.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@
55
margin-left: 10px;
66

77
color: var(--yc-color-text-complementary);
8+
9+
&__item-with-popover {
10+
white-space: nowrap;
11+
}
12+
13+
&__popover {
14+
max-width: 300px;
15+
}
816
}

src/containers/Tenant/Query/QueryDuration/QueryDuration.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import block from 'bem-cn-lite';
22

33
import {formatDurationToShortTimeFormat, parseUsToMs} from '../../../../utils/timeParsers';
4+
import {LabelWithPopover} from '../../../../components/LabelWithPopover';
5+
6+
import i18n from '../i18n';
47

58
import './QueryDuration.scss';
69

@@ -17,5 +20,14 @@ export const QueryDuration = ({duration}: QueryDurationProps) => {
1720

1821
const parsedDuration = formatDurationToShortTimeFormat(parseUsToMs(duration), 1);
1922

20-
return <span className={b()}>{parsedDuration}</span>;
23+
return (
24+
<span className={b()}>
25+
<LabelWithPopover
26+
className={b('item-with-popover')}
27+
contentClassName={b('popover')}
28+
text={parsedDuration}
29+
popoverContent={i18n('query-duration.description')}
30+
/>
31+
</span>
32+
);
2133
};

src/containers/Tenant/Query/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
"method-description.script": "For YQL-scripts combining DDL and DML.\nAPI call: schema.scripting",
2121
"method-description.scan": "Read-only queries, potentially reading a lot of data.\nAPI call: table.ExecuteScan",
2222
"method-description.data": "DML queries for changing and fetching data in serialization mode.\nAPI call: table.executeDataQuery",
23-
"method-description.query": "Any queries. An experimental API call supposed to replace all existing methods.\nAPI Call: query.ExecuteScript"
23+
"method-description.query": "Any queries. An experimental API call supposed to replace all existing methods.\nAPI Call: query.ExecuteScript",
24+
25+
"query-duration.description": "Duration of server-side query execution"
2426
}

src/containers/Tenant/Query/i18n/ru.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
"method-description.script": "Для скриптов, совмещающих DDL и DML-конструкции.\nAPI call: schema.scripting",
2121
"method-description.scan": "Только читающие запросы, потенциально читающие много данных.\nAPI call: table.ExecuteScan",
2222
"method-description.data": "DML-запросы для изменения и выборки данных в режиме изоляции Serializable.\nAPI call: table.executeDataQuery",
23-
"method-description.query": "Любые запросы. Экспериментальный перспективный метод, который в будущем заменит все остальные.\nAPI call: query.ExecuteScript"
23+
"method-description.query": "Любые запросы. Экспериментальный перспективный метод, который в будущем заменит все остальные.\nAPI call: query.ExecuteScript",
24+
25+
"query-duration.description": "Время выполнения запроса на стороне сервера"
2426
}

0 commit comments

Comments
 (0)