Skip to content

Commit f4d5035

Browse files
HyteqHyteq
authored andcommitted
fix: performance shows duplicated paths sometimes due to not grouping by domain
1 parent 917331d commit f4d5035

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

apps/api/src/query/builders/performance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { createQueryBuilder, METRICS } from '../utils'
44
export const performanceBuilders: Record<string, ParameterBuilder> = {
55
slow_pages: createQueryBuilder({
66
metricSet: METRICS.performance,
7-
nameColumn: 'path',
8-
groupByColumns: ['path'],
7+
nameColumn: 'cutQueryString(path)',
8+
groupByColumns: ['cutQueryString(path)'],
99
extraWhere: "load_time > 0 AND path != ''",
1010
orderBy: 'avg_load_time DESC'
1111
}),

packages/db/src/client.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { drizzle } from 'drizzle-orm/node-postgres';
2-
import { migrate } from 'drizzle-orm/node-postgres/migrator';
32
import * as schema from './drizzle/schema';
43
import * as relations from './drizzle/relations';
54

@@ -12,10 +11,4 @@ if (!databaseUrl) {
1211
throw new Error('DATABASE_URL is not set');
1312
}
1413

15-
export const db = drizzle(databaseUrl, { schema: fullSchema });
16-
17-
const migrateDb = async () => {
18-
await migrate(db, { migrationsFolder: 'drizzle/migrations' });
19-
}
20-
21-
migrateDb();
14+
export const db = drizzle(databaseUrl, { schema: fullSchema });

0 commit comments

Comments
 (0)