Skip to content

Commit

Permalink
chore: add avg_usage_memory for most expensive queries
Browse files Browse the repository at this point in the history
  • Loading branch information
duyet committed Nov 27, 2023
1 parent 83fc702 commit b314ce5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions app/[query]/clickhouse-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ export const queries: Array<QueryConfig> = [
query,
user,
count() as cnt,
sum(memory_usage) AS memory,
formatReadableSize(sum(memory_usage)) AS readable_memory,
sum(memory_usage) AS sum_memory,
avg(memory_usage) AS avg_memory,
formatReadableSize(sum_memory) AS readable_sum_memory,
formatReadableSize(avg_memory) AS readable_avg_memory,
normalized_query_hash
FROM
clusterAllReplicas(default, system.query_log)
Expand All @@ -209,11 +211,16 @@ export const queries: Array<QueryConfig> = [
query,
user
ORDER BY
memory DESC
avg_memory DESC
LIMIT 1000
`,

columns: ['query', 'user', 'cnt', 'readable_memory'],
columns: [
'query',
'user',
'cnt',
'readable_avg_memory',
'readable_sum_memory',
],
columnFormats: {
query: ColumnFormat.CodeToggle,
},
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: "8zgiqh",
projectId: '8zgiqh',
defaultCommandTimeout: 15000,
fixturesFolder: false,
e2e: {
Expand Down

0 comments on commit b314ce5

Please sign in to comment.