(sessionId: string)
| 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') |
no test coverage detected