{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dropto-run/json-schema/dropto-run-site-traffic-overview-schema.json",
  "title": "SiteTrafficOverview",
  "description": "The traffic page's overview for one range, audience and set of filters.",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dropto-run-openapi.json#/components/schemas/SiteTrafficOverview",
  "properties": {
    "asOf": {
      "description": "When the Analytics Engine figures were read, or null when none were.",
      "format": "date-time",
      "type": [
        "null",
        "string"
      ]
    },
    "available": {
      "description": "False when Analytics Engine could not be read and nothing was kept.",
      "type": "boolean"
    },
    "breakdownDays": {
      "description": "Days the lists, globe and status split cover — the range, capped at what\n    Analytics Engine keeps.",
      "format": "int32",
      "pattern": "^-?(?:0|[1-9]\\d*)$",
      "type": [
        "integer",
        "string"
      ]
    },
    "bucket": {
      "description": "Width of a chart point: `hour`, `day` or `week`.",
      "type": "string"
    },
    "days": {
      "description": "Its length in days.",
      "format": "int32",
      "pattern": "^-?(?:0|[1-9]\\d*)$",
      "type": [
        "integer",
        "string"
      ]
    },
    "documents": {
      "$ref": "#/$defs/TrafficDocuments",
      "description": "The documents table, by UTC day.",
      "__uniqueRefKey": "#/components/schemas/TrafficDocuments__13"
    },
    "from": {
      "description": "First instant of the range, UTC.",
      "format": "date-time",
      "type": "string"
    },
    "measuredSince": {
      "description": "First day anything was rolled up for this site, or null.",
      "format": "date-time",
      "type": [
        "null",
        "string"
      ]
    },
    "previous": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TrafficTotals",
          "description": "The same figures for the period before, or null when it was not fully measured\n    or cannot be filtered. A null figure inside it means that figure cannot be compared.",
          "__uniqueRefKey": "#/components/schemas/TrafficTotals__14"
        }
      ]
    },
    "range": {
      "description": "The range as the page spells it: `24h`, `12m`, or `{N}d`.",
      "type": "string"
    },
    "sampled": {
      "description": "Whether any figure is an estimate from sampled rows.",
      "type": "boolean"
    },
    "series": {
      "description": "The chart, or null when Analytics Engine could not be read.",
      "items": {
        "$ref": "#/$defs/TrafficSeriesPoint"
      },
      "type": [
        "null",
        "array"
      ]
    },
    "seriesFrom": {
      "description": "Where the chart and tiles start: From, except on a filtered\n    range longer than BreakdownDays, where only the breakdown window can be filtered.",
      "format": "date-time",
      "type": "string"
    },
    "speed": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TrafficSpeed",
          "description": "Edge speed and cache share over the breakdown window, or null without the detail\n    capability, when they could not be read, or when nothing was measured.",
          "__uniqueRefKey": "#/components/schemas/TrafficSpeed__15"
        }
      ]
    },
    "speedAvailable": {
      "description": "False when the speed figures were asked for and could not be read, so a\n    null Speed means \"couldn't load\" rather than \"nothing measured\".",
      "type": "boolean"
    },
    "splitSince": {
      "description": "First whole day bots were counted apart from people and arrivals were recorded, or null when not yet.\nBefore it, people include bots and visits are unknown; the page marks the day. Equal to\nMeasuredSince for a site that was split from its first day, which has no \"before\".",
      "format": "date-time",
      "type": [
        "null",
        "string"
      ]
    },
    "status": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TrafficStatusSplit",
          "description": "Requests by status class over the breakdown window, or null when unreadable.",
          "__uniqueRefKey": "#/components/schemas/TrafficStatusSplit__16"
        }
      ]
    },
    "to": {
      "description": "End of the range, exclusive: the top of the next hour.",
      "format": "date-time",
      "type": "string"
    },
    "totals": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TrafficTotals",
          "description": "The tiles, or null when they could not be read.",
          "__uniqueRefKey": "#/components/schemas/TrafficTotals__17"
        }
      ]
    }
  },
  "required": [
    "range",
    "days",
    "from",
    "to",
    "bucket",
    "seriesFrom",
    "series",
    "totals",
    "previous",
    "status",
    "breakdownDays",
    "measuredSince",
    "documents",
    "asOf",
    "sampled",
    "available",
    "splitSince",
    "speed",
    "speedAvailable"
  ],
  "type": "object",
  "$defs": {
    "SiteTrafficDocument": {
      "description": "One document's figures over the traffic window.",
      "properties": {
        "downloads": {
          "description": "Loads through the reader's Download button.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        },
        "path": {
          "description": "The path with its leading slash, decoded. Recorded from requests and cut at 128 characters, so it is\nrendered as text rather than a link, like the top lists.",
          "type": "string"
        },
        "views": {
          "description": "Loads of the file without the download flag.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "path",
        "views",
        "downloads"
      ],
      "type": "object"
    },
    "TrafficDocuments": {
      "description": "The documents table and the UTC days it covers.",
      "properties": {
        "from": {
          "description": "First day counted.",
          "format": "date-time",
          "type": "string"
        },
        "rows": {
          "description": "Documents, most viewed first.",
          "items": {
            "$ref": "#/$defs/SiteTrafficDocument"
          },
          "type": "array"
        },
        "to": {
          "description": "Last day counted.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "from",
        "to",
        "rows"
      ],
      "type": "object"
    },
    "TrafficSeriesPoint": {
      "description": "One point of the traffic chart.",
      "properties": {
        "bytes": {
          "description": "Bytes sent, or null before measurement began.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "pageviews": {
          "description": "Page views, or null before measurement began.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "requests": {
          "description": "Requests, or null before measurement began.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "start": {
          "description": "Start of the bucket, UTC.",
          "format": "date-time",
          "type": "string"
        },
        "visits": {
          "description": "Arrivals by people, or null before they were recorded.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "start",
        "requests",
        "pageviews",
        "bytes",
        "visits"
      ],
      "type": "object"
    },
    "TrafficSpeed": {
      "description": "How fast the edge answered and how much its cache served.",
      "properties": {
        "cacheHitRate": {
          "description": "Share of requests the edge cache answered, between 0 and 1.",
          "format": "double",
          "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
          "type": [
            "number",
            "string"
          ]
        },
        "medianMs": {
          "description": "Median wait at the edge before the response existed, in milliseconds.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "p95Ms": {
          "description": "95th percentile of the same wait.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "medianMs",
        "p95Ms",
        "cacheHitRate"
      ],
      "type": "object"
    },
    "TrafficStatusSplit": {
      "description": "Requests by status class.",
      "properties": {
        "s2xx": {
          "description": "Successful.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        },
        "s3xx": {
          "description": "Redirected or not modified.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        },
        "s4xx": {
          "description": "Client errors, 404 included.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        },
        "s5xx": {
          "description": "Server errors.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "s2xx",
        "s3xx",
        "s4xx",
        "s5xx"
      ],
      "type": "object"
    },
    "TrafficTotals": {
      "description": "The figures on the traffic page's tiles.",
      "properties": {
        "bytes": {
          "description": "Bytes of body sent.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "errorRate": {
          "description": "Share of requests answered 4xx or 5xx, or null when it cannot be computed.",
          "format": "double",
          "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
          "type": [
            "null",
            "number",
            "string"
          ]
        },
        "pageviews": {
          "description": "Page views.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "requests": {
          "description": "Requests of every kind.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        },
        "visits": {
          "description": "Page views by people who arrived from another site or typed the address — not unique people — or null\nwhen arrivals were not recorded for the period.",
          "format": "int64",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "null",
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "pageviews",
        "requests",
        "bytes",
        "errorRate",
        "visits"
      ],
      "type": "object"
    }
  }
}