{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pingzen-dev/json-schema/pingzen-dev-dashboard-stats-response-schema.json",
  "title": "DashboardStatsResponse",
  "description": "Dashboard summary statistics: the counters plus uptime and activity aggregates.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pingzen-dev-openapi.json#/components/schemas/DashboardStatsResponse",
  "properties": {
    "total_monitors": {
      "type": "integer",
      "title": "Total Monitors",
      "description": "Total number of monitors"
    },
    "monitors_up": {
      "type": "integer",
      "title": "Monitors Up",
      "description": "Monitors currently UP"
    },
    "monitors_down": {
      "type": "integer",
      "title": "Monitors Down",
      "description": "ACTIVE monitors in a critical state (DOWN + TIMEOUT merged; paused monitors are excluded and counted in monitors_paused)"
    },
    "monitors_degraded": {
      "type": "integer",
      "title": "Monitors Degraded",
      "description": "ACTIVE monitors in the degraded tier: DEGRADED + PARTIAL + WARNING statuses (DNSBL excluded). monitors_partial is a subset of this count — do NOT sum the two"
    },
    "monitors_partial": {
      "type": "integer",
      "title": "Monitors Partial",
      "description": "Monitors in PARTIAL outage (down from some probe locations, up from others) — subset of monitors_degraded",
      "default": 0
    },
    "monitors_timeout": {
      "type": "integer",
      "title": "Monitors Timeout",
      "description": "ACTIVE monitors in TIMEOUT — subset of monitors_down (DNSBL excluded)",
      "default": 0
    },
    "monitors_unknown": {
      "type": "integer",
      "title": "Monitors Unknown",
      "description": "Active monitors outside the up/down/degraded categories (never checked, transient, skipped, DNSBL-listed in a problem state) — the five categories up/down/degraded/unknown/paused sum to total_monitors",
      "default": 0
    },
    "monitors_paused": {
      "type": "integer",
      "title": "Monitors Paused",
      "description": "Monitors currently paused (inactive)"
    },
    "total_heartbeats": {
      "type": "integer",
      "title": "Total Heartbeats",
      "description": "Total number of heartbeat monitors"
    },
    "heartbeats_up": {
      "type": "integer",
      "title": "Heartbeats Up",
      "description": "Heartbeats currently UP"
    },
    "heartbeats_down": {
      "type": "integer",
      "title": "Heartbeats Down",
      "description": "Heartbeats currently DOWN"
    },
    "heartbeats_pending": {
      "type": "integer",
      "title": "Heartbeats Pending",
      "description": "Heartbeats awaiting first ping"
    },
    "heartbeats_paused": {
      "type": "integer",
      "title": "Heartbeats Paused",
      "description": "Heartbeats currently paused (inactive)",
      "default": 0
    },
    "total_alerts": {
      "type": "integer",
      "title": "Total Alerts",
      "description": "Total number of alert configurations"
    },
    "alerts_active": {
      "type": "integer",
      "title": "Alerts Active",
      "description": "Currently active alerts"
    },
    "incidents_ongoing": {
      "type": "integer",
      "title": "Incidents Ongoing",
      "description": "Open incident records of the workspace (or of every accessible workspace without workspace_id): investigating + identified + monitoring, PARTIAL, DNSBL, paused-monitor and monitor-less ones included, deleted monitors excluded. Same predicate as GET /incidents/open (its total) and /incidents/stats.ongoing; 0 for a workspace the caller cannot access",
      "default": 0
    },
    "global_total_monitors": {
      "type": "integer",
      "title": "Global Total Monitors",
      "description": "Total monitors + heartbeats across all workspaces (for plan limit X/55 — heartbeats share the monitor budget)",
      "default": 0
    },
    "global_total_alerts": {
      "type": "integer",
      "title": "Global Total Alerts",
      "description": "Total alerts across all workspaces (for plan limit X/50)",
      "default": 0
    },
    "overall_uptime_24h": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Overall Uptime 24H",
      "description": "Overall uptime % in last 24 hours"
    },
    "overall_uptime_7d": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Overall Uptime 7D",
      "description": "Overall uptime % in last 7 days"
    },
    "overall_uptime_30d": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Overall Uptime 30D",
      "description": "Overall uptime % in last 30 days"
    },
    "overall_uptime_1h": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Overall Uptime 1H",
      "description": "Overall uptime % in the last hour, over monitors checked at least every 15 minutes. Filled only when period=1h"
    },
    "avg_response_time_24h": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Avg Response Time 24H",
      "description": "Average response time in last 24 hours (ms)"
    },
    "checks_last_24h": {
      "type": "integer",
      "title": "Checks Last 24H",
      "description": "Total checks in last 24 hours"
    },
    "incidents_last_24h": {
      "type": "integer",
      "title": "Incidents Last 24H",
      "description": "Incident records open now or resolved in the last 24 hours, the rule of /incidents/stats?since=now-24h (its total)"
    },
    "alerts_sent_last_24h": {
      "type": "integer",
      "title": "Alerts Sent Last 24H",
      "description": "Alerts sent in last 24 hours"
    },
    "checks_in_period": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Checks In Period",
      "description": "Total checks in selected period"
    },
    "incidents_in_period": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Incidents In Period",
      "description": "Incident records open now or resolved in the selected period, the rule of /incidents/stats?since=<period start> (its total)"
    }
  },
  "type": "object",
  "required": [
    "total_monitors",
    "monitors_up",
    "monitors_down",
    "monitors_degraded",
    "monitors_paused",
    "total_heartbeats",
    "heartbeats_up",
    "heartbeats_down",
    "heartbeats_pending",
    "total_alerts",
    "alerts_active",
    "checks_last_24h",
    "incidents_last_24h",
    "alerts_sent_last_24h"
  ]
}