feat: implement Swapper metrics collection and UI

This commit is contained in:
Apple
2025-11-30 15:12:49 -08:00
parent 5b5160ad8b
commit fd814b2059
11 changed files with 1224 additions and 4543 deletions

View File

@@ -0,0 +1,16 @@
# Fetch MicroDAOs where orchestrator is on this node
print(f"DEBUG: Fetching microdaos for node {node_id}")
try:
microdaos = await pool.fetch("""
SELECT m.id, m.slug, m.name, COUNT(cr.id) as rooms_count
FROM microdaos m
JOIN agents a ON m.orchestrator_agent_id = a.id
LEFT JOIN city_rooms cr ON cr.microdao_id::text = m.id
WHERE a.node_id = $1
GROUP BY m.id, m.slug, m.name
ORDER BY m.name
""", node_id)
print(f"DEBUG: Microdaos fetched: {len(microdaos)}")
except Exception as e:
print(f"DEBUG: Error fetching microdaos: {e}")
raise e