GET /xrpc/app.bsky.actor.searchActorsTypeahead typeahead.waow.tech
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix avg latency metric: use last 24h instead of 7-day window

the 7-day window was dominated by write-contention spikes from
bulk operations, showing 439ms when current performance is ~111ms.
24h window lets transient spikes age out in a day.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+6 -3
+5 -2
src/handlers/stats.ts
··· 71 71 const hiddenCount = dbSnapshots.length > 0 ? (dbSnapshots[dbSnapshots.length - 1].hidden ?? 0) : 0; 72 72 73 73 const totalSearches = rows.reduce((s, r) => s + r.searches, 0); 74 - const totalMs = rows.reduce((s, r) => s + r.total_ms, 0); 75 - const avgLatency = totalSearches > 0 ? totalMs / totalSearches : 0; 74 + // avg latency over last 24h only (288 five-min buckets) so transient spikes age out quickly 75 + const recentRows = rows.slice(0, 288); 76 + const recentSearches = recentRows.reduce((s, r) => s + r.searches, 0); 77 + const recentMs = recentRows.reduce((s, r) => s + r.total_ms, 0); 78 + const avgLatency = recentSearches > 0 ? recentMs / recentSearches : 0; 76 79 const handlePct = total > 0 ? ((withHandles / total) * 100).toFixed(1) : "0"; 77 80 const avatarPct = total > 0 ? ((withAvatars / total) * 100).toFixed(1) : "0"; 78 81
+1 -1
src/pages/stats.ts
··· 187 187 <div class="value">${d.totalSearches.toLocaleString()}</div> 188 188 </div> 189 189 <div class="metric"> 190 - <div class="label" data-tip="average response time for uncached searches">avg latency</div> 190 + <div class="label" data-tip="average response time for uncached searches (last 24h)">avg latency</div> 191 191 <div class="value">${d.avgLatency.toFixed(1)} ms</div> 192 192 </div> 193 193 </div>