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

Function settle

apps/api/e2e/session-stress.ts:139–151  ·  view source on GitHub ↗
(sessions: Session[])

Source from the content-addressed store, hash-verified

137}
138
139async function settle(sessions: Session[]) {
140 scenario('settle: all sessions opened in ClickHouse');
141 const ids = sessions.map((s) => s.sessionId);
142 const starts = await pollUntil(
143 async () => {
144 const c = await countByName(ids, 'session_start');
145 console.log(` …session_start ${c}/${ids.length}`);
146 return c >= ids.length ? c : null;
147 },
148 { timeoutMs: 60_000, intervalMs: 2000 }
149 );
150 check('clickhouse: one session_start per session', starts === ids.length, `got ${starts}`);
151}
152
153async function drain(sessions: Session[]) {
154 scenario('drain: reap + flush until nothing remains');

Callers 1

mainFunction · 0.85

Calls 6

scenarioFunction · 0.90
pollUntilFunction · 0.90
countByNameFunction · 0.90
checkFunction · 0.90
mapMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected