MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getTopEventNames

Function getTopEventNames

packages/db/src/services/event.service.ts:1188–1201  ·  view source on GitHub ↗
(projectId: string)

Source from the content-addressed store, hash-verified

1186import { resolveDateRange } from './date.service';
1187
1188export async function getTopEventNames(projectId: string): Promise<string[]> {
1189 return getCache(`mcp:event-names:${projectId}`, 60 * 10, async () => {
1190 const rows = await clix(ch)
1191 .select<IClickhouseEvent>(['name', 'count() as count'])
1192 .from(TABLE_NAMES.event_names_mv)
1193 .where('project_id', '=', projectId)
1194 .groupBy(['name'])
1195 .orderBy('count', 'DESC')
1196 .limit(50)
1197 .execute();
1198
1199 return rows.map((r) => r.name);
1200 });
1201}
1202
1203export const listEventNamesCore = (projectId: string): Promise<string[]> =>
1204 getTopEventNames(projectId);

Callers 2

registerEventNameToolsFunction · 0.90
listEventNamesCoreFunction · 0.85

Calls 9

getCacheFunction · 0.90
clixFunction · 0.90
executeMethod · 0.80
limitMethod · 0.80
orderByMethod · 0.80
groupByMethod · 0.80
whereMethod · 0.45
fromMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected