-- name: PlatformCounts :one -- System scope. Platform totals for the operator metrics. SELECT (SELECT count(*) FROM orgs)::bigint AS orgs, (SELECT count(*) FROM users)::bigint AS users, (SELECT count(*) FROM status_pages)::bigint AS status_pages, (SELECT count(*) FROM status_page_subscribers WHERE confirmed_at IS NOT NULL)::bigint AS subscribers, (SELECT count(*) FROM incidents WHERE resolved_at IS NULL)::bigint AS open_incidents, (SELECT count(*) FROM notifications WHERE status = 'pending')::bigint AS pending_notifications, (SELECT count(*) FROM subscriber_notifications WHERE status = 'pending')::bigint AS pending_subscriber_notifications; -- name: MonitorCounts :many -- System scope. Monitors by type and whether they are enabled. SELECT type, enabled, count(*)::bigint AS monitors FROM monitors GROUP BY type, enabled ORDER BY type, enabled;