MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getStats

Method getStats

src/services/session-index/fetch.ts:58–70  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

56 }
57
58 async getStats(sessionId: string): Promise<SessionStats> {
59 try {
60 const rows = await getDataAdapter().pluginQuery<{ cnt: number }>(
61 sessionId,
62 'SELECT COUNT(*) as cnt FROM segment',
63 []
64 )
65 const count = rows[0]?.cnt ?? 0
66 return { hasIndex: count > 0, sessionCount: count, gapThreshold: 1800 }
67 } catch {
68 return { hasIndex: false, sessionCount: 0, gapThreshold: 1800 }
69 }
70 }
71
72 async getAllIndexStats(): Promise<SessionIndexStatusItem[]> {
73 const resp = await fetchWithAuth('/_web/sessions/index-stats')

Callers 1

hasIndexMethod · 0.95

Calls 1

getDataAdapterFunction · 0.70

Tested by

no test coverage detected