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

Function countByName

apps/api/e2e/lib.ts:144–153  ·  view source on GitHub ↗
(
  sessionIds: string[],
  name: string
)

Source from the content-addressed store, hash-verified

142 ids.map((id) => `'${id.replace(/'/g, "")}'`).join(',');
143
144export async function countByName(
145 sessionIds: string[],
146 name: string
147): Promise<number> {
148 if (sessionIds.length === 0) return 0;
149 const rows = await chQuery<{ c: string }>(
150 `SELECT count() AS c FROM events WHERE project_id = '${PROJECT_ID}' AND name = '${name}' AND session_id IN (${quoteList(sessionIds)})`
151 );
152 return Number(rows[0]?.c ?? 0);
153}
154
155// ── Fixtures ────────────────────────────────────────────────────────────────
156export async function ensureFixtures() {

Callers 5

settleFunction · 0.90
drainFunction · 0.90
scenarioSingleSessionFunction · 0.90
scenarioBoundaryFunction · 0.90

Calls 1

quoteListFunction · 0.85

Tested by

no test coverage detected