-
Notifications
You must be signed in to change notification settings - Fork 14
/
menu.ts
293 lines (291 loc) · 8.58 KB
/
menu.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import {
ArchiveIcon,
BarChartIcon,
CopyIcon,
CounterClockwiseClockIcon,
CrossCircledIcon,
DashboardIcon,
ExclamationTriangleIcon,
GearIcon,
HamburgerMenuIcon,
HomeIcon,
InfoCircledIcon,
LightningBoltIcon,
MixIcon,
ShuffleIcon,
TableIcon,
TextAlignBottomIcon,
UpdateIcon,
} from '@radix-ui/react-icons'
import { type MenuItem } from '@/components/menu/types'
import { QUERY_COMMENT } from '@/lib/clickhouse'
import {
CircleDollarSignIcon,
CombineIcon,
DatabaseZapIcon,
FilePlus2Icon,
Grid2x2CheckIcon,
HardDriveIcon,
RollerCoasterIcon,
ShieldAlertIcon,
UngroupIcon,
UnplugIcon,
} from 'lucide-react'
export const menuItemsConfig: MenuItem[] = [
{
title: 'Overview',
href: '/overview',
icon: HomeIcon,
},
{
title: 'Tables',
href: '/tables',
icon: TableIcon,
items: [
{
title: 'Tables Explorer',
href: '/database',
countSql: `SELECT COUNT() FROM system.tables WHERE lower(database) NOT IN ('system', 'information_schema') AND is_temporary = 0 AND engine LIKE '%MergeTree%'`,
description: 'List of databases, tables and their details',
icon: TableIcon,
},
{
title: 'Tables Overview',
href: '/tables-overview',
countSql:
'SELECT countDistinct(database || table) as `count()` FROM system.parts',
description: 'Overview of all tables and their parts',
icon: Grid2x2CheckIcon,
},
{
title: 'Distributed DDL Queue',
href: '/distributed-ddl-queue',
countSql: `SELECT COUNT() FROM system.distributed_ddl_queue WHERE status != 'Finished'`,
description:
'Distributed ddl queries (ON CLUSTER clause) that were executed on a cluster',
icon: ShuffleIcon,
},
{
title: 'Table Replicas',
href: '/replicas',
description:
'Contains information and status for replicated tables residing on the local server',
countSql: `SELECT COUNT() FROM system.replicas`,
icon: CopyIcon,
},
{
title: 'Replication Queue',
href: '/replication-queue',
description:
'Contains information about tasks from replication queues stored in ClickHouse Keeper, or ZooKeeper, for tables in the ReplicatedMergeTree family',
countSql: `SELECT COUNT() FROM system.replication_queue`,
icon: ShuffleIcon,
},
{
title: 'Readonly Tables',
href: '/readonly-tables',
description: 'Readonly tables and their replicas',
countSql: `SELECT COUNT() FROM system.replicas WHERE is_readonly = 1`,
countVariant: 'destructive',
icon: ExclamationTriangleIcon,
},
{
title: 'Top Usage Tables',
href: '/top-usage-tables',
description: 'Most used tables, excluding system tables',
icon: TextAlignBottomIcon,
},
{
title: 'Projections',
href: '/projections',
description:
'Projections store data in a format that optimizes query execution',
icon: DatabaseZapIcon,
},
],
},
{
title: 'Queries',
href: '',
countSql: `SELECT COUNT() FROM system.processes WHERE is_cancelled = 0 AND query NOT LIKE '%${QUERY_COMMENT}%'`,
icon: MixIcon,
items: [
{
title: 'Running Queries',
href: '/running-queries',
description: 'Queries that are currently running',
countSql: `SELECT COUNT() FROM system.processes WHERE is_cancelled = 0 AND query NOT LIKE '%${QUERY_COMMENT}%'`,
icon: MixIcon,
},
{
title: 'History Queries',
href: '/history-queries',
description:
'Queries that have been run including successed, failed queries with resourses usage details',
icon: CounterClockwiseClockIcon,
},
{
title: 'Failed Queries',
href: '/failed-queries',
description: 'Which queries have failed?',
icon: CrossCircledIcon,
},
{
title: 'Latest Common Errors',
href: '/common-errors',
description:
'Exploring the system.errors table to see when the error last occurred',
icon: CrossCircledIcon,
},
{
title: 'Most Expensive Queries',
href: '/expensive-queries',
description: 'Most expensive queries by many factors',
icon: CircleDollarSignIcon,
},
{
title: 'Most Expensive Queries by Memory',
href: '/expensive-queries-by-memory',
description: 'Most expensive queries by memory',
icon: CircleDollarSignIcon,
},
{
title: 'New Parts Created',
href: '/charts/new-parts-created',
description: 'How many (and how often) new parts are created',
icon: FilePlus2Icon,
},
{
title: 'Explain',
href: '/explain',
description: 'Shows the execution plan of a statement',
icon: InfoCircledIcon,
},
{
title: 'Query Cache',
href: '/query-cache',
description: 'Query cache usage',
icon: DatabaseZapIcon,
},
],
},
{
title: 'Merges',
href: '/merges',
countSql: `SELECT COUNT() FROM system.merges WHERE 1 = 1`,
icon: CombineIcon,
items: [
{
title: 'Merges',
href: '/merges',
description:
'Merges and part mutations currently in process for tables in the MergeTree family',
countSql: `SELECT COUNT() FROM system.merges WHERE 1 = 1`,
icon: CombineIcon,
},
{
title: 'Merge Performance',
href: '/merge-performance',
description: 'Merge performance over day, avg duration, avg rows read',
icon: LightningBoltIcon,
},
{
title: 'Mutations',
href: '/mutations',
description:
'Information about mutations of MergeTree tables and their progress',
icon: UpdateIcon,
},
],
},
{
title: 'More',
href: '',
icon: HamburgerMenuIcon,
items: [
{
title: 'Settings',
href: '/settings',
description:
'The values of global server settings which can be viewed in the table `system.settings`',
icon: GearIcon,
},
{
title: 'MergeTree Settings',
href: '/mergetree-settings',
description:
'The values of merge_tree settings (for all MergeTree tables) which can be viewed in the table `system.merge_tree_settings`',
icon: TableIcon,
},
{
title: 'Disks',
href: '/disks',
description:
'The values of disk settings which can be viewed in the table `system.disks`',
countSql: `SELECT COUNT() FROM system.disks`,
icon: HardDriveIcon,
},
{
title: 'Backups',
href: '/backups',
description:
'Backups and restores tables and databases. The information is taken from the system.backup_log table',
countSql: `SELECT COUNT() FROM system.backup_log WHERE status = 'BACKUP_CREATED'`,
icon: ArchiveIcon,
},
{
title: 'Metrics',
href: '/metrics',
description:
'Contains metrics which can be calculated instantly, or have a current value',
icon: BarChartIcon,
},
{
title: 'Asynchronous Metrics',
href: '/asynchronous-metrics',
description:
'Contains metrics that are calculated periodically in the background',
icon: BarChartIcon,
},
{
title: 'Custom Dashboard',
href: '/dashboard',
description:
'Custom dashboard for monitoring ClickHouse. You can add your own charts and configure them',
icon: DashboardIcon,
},
{
title: 'Clusters',
href: '/clusters',
description:
'Information about clusters available in the config file and the servers in them',
icon: UngroupIcon,
},
{
title: 'Zookeeper',
href: '/zookeeper?path=/',
description:
'Exposes data from the Keeper cluster defined in the config',
icon: RollerCoasterIcon,
},
{
title: 'Connections',
href: '/charts/connections-http,connections-interserver',
description: 'Number of connections over time',
icon: UnplugIcon,
},
{
title: 'Errors',
href: '/errors',
description: 'System error logs and history',
icon: ShieldAlertIcon,
},
{
title: 'About',
href: '/about',
description: 'About dashboard UI and ClickHouse server',
icon: InfoCircledIcon,
},
],
},
]