forked from snxraven/p2ns
Add Core RPC section to admin Stats tab
Surface invite diagnostics (RPC health, per-peer state, queues, recommendations) under Resource Usage via /api/stats core payload and auto-refreshing renderCoreStats in the stats UI.
This commit is contained in:
@@ -304,6 +304,17 @@ async function handleStatsRoutes(req, res) {
|
||||
// Collect Hyperdrive stats
|
||||
const hyperdriveStats = collectHyperdriveStats();
|
||||
stats.hyperdrive = hyperdriveStats;
|
||||
|
||||
if (typeof state.diagnoseInviteIssues === 'function') {
|
||||
try {
|
||||
stats.core = state.diagnoseInviteIssues();
|
||||
} catch (err) {
|
||||
logDebug('Admin', `Core RPC stats unavailable: ${err.message}`);
|
||||
stats.core = { initializing: true, error: err.message };
|
||||
}
|
||||
} else {
|
||||
stats.core = { initializing: true };
|
||||
}
|
||||
|
||||
const responseTime = Date.now() - startTime;
|
||||
trackRequestWithTiming('/api/stats', true, responseTime);
|
||||
|
||||
Reference in New Issue
Block a user