{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PerformanceMetric",
  "description": "PerformanceMetric schema from Palo Alto Networks Autonomous DEM API",
  "$id": "https://raw.githubusercontent.com/api-evangelist/palo-alto-networks/refs/heads/main/json-schema/autonomous-dem-api-performance-metric-schema.json",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time bucket for the aggregated metric."
    },
    "user_id": {
      "type": "string",
      "description": "User identifier."
    },
    "site_name": {
      "type": "string",
      "description": "Site name."
    },
    "app_id": {
      "type": "string",
      "description": "Application identifier if metric is application-specific."
    },
    "metric_type": {
      "type": "string",
      "enum": [
        "latency",
        "packet_loss",
        "jitter",
        "throughput",
        "dns_resolution",
        "tcp_connection"
      ],
      "description": "Type of performance metric."
    },
    "value": {
      "type": "number",
      "description": "Metric value in the appropriate unit for the metric type."
    },
    "unit": {
      "type": "string",
      "description": "Unit of measurement (e.g., ms, pct, Mbps)."
    },
    "segment": {
      "type": "string",
      "enum": [
        "endpoint",
        "local_network",
        "isp",
        "prisma_access",
        "application"
      ],
      "description": "Network segment this metric applies to."
    },
    "sample_count": {
      "type": "integer",
      "description": "Number of measurement samples in this time bucket."
    }
  }
}
