From 2b7ed064d19a922b562745fcb04b09e47358f641 Mon Sep 17 00:00:00 2001 From: you Date: Fri, 20 Mar 2026 02:10:27 +0000 Subject: [PATCH] perf page: show server + client cache stats --- public/index.html | 2 +- public/perf.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 61920a01..b470ec86 100644 --- a/public/index.html +++ b/public/index.html @@ -87,6 +87,6 @@ - + diff --git a/public/perf.js b/public/perf.js index 3ba857c9..92f6f22a 100644 --- a/public/perf.js +++ b/public/perf.js @@ -28,6 +28,26 @@
${server.slowQueries.length}
Slow (>100ms)
`; + // Cache stats + if (server.cache) { + const c = server.cache; + const clientCache = _apiCache ? _apiCache.size : 0; + html += `

Cache

+
${c.size}
Server Entries
+
${c.hits}
Server Hits
+
${c.misses}
Server Misses
+
${c.hitRate}%
Server Hit Rate
+
${clientCache}
Client Entries
+
`; + if (client) { + html += `
+
${client.cacheHits || 0}
Client Hits
+
${client.cacheMisses || 0}
Client Misses
+
${client.cacheHitRate || 0}%
Client Hit Rate
+
`; + } + } + // Server endpoints table const eps = Object.entries(server.endpoints); if (eps.length) {