{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prro-cloud/json-schema/prro-cloud-dpspulse-schema.json",
  "title": "DPSPulse",
  "description": "Режим роботи з ДПС і телеметрія, яка пояснює цей режим. Сервіс працює з ДПС за значенням effective.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prro-cloud-openapi.yaml#/components/schemas/DPSPulse",
  "type": "object",
  "required": [
    "effective",
    "verdict",
    "since",
    "latency_ms",
    "samples",
    "failures",
    "tunables"
  ],
  "properties": {
    "effective": {
      "type": "string",
      "enum": [
        "online",
        "offline"
      ],
      "description": "Поточний режим роботи сервісу з ДПС."
    },
    "verdict": {
      "type": "string",
      "enum": [
        "online",
        "degraded",
        "offline"
      ],
      "description": "Результат детектора. Значення degraded означає «повільно», offline — «недоступно»."
    },
    "since": {
      "type": "string",
      "format": "date-time",
      "description": "Час, з якого діє поточне значення effective."
    },
    "latency_ms": {
      "type": "integer",
      "format": "int64",
      "description": "Затримка успішних запитів у вікні детектора, у мілісекундах. Значення 0 означає, що у вікні немає успішних запитів."
    },
    "samples": {
      "type": "integer",
      "description": "Кількість запитів у вікні детектора."
    },
    "failures": {
      "type": "integer",
      "description": "Кількість невдалих запитів у вікні детектора."
    },
    "last_ok_at": {
      "type": "string",
      "format": "date-time",
      "description": "Час останньої успішної відповіді ДПС."
    },
    "last_probe_at": {
      "type": "string",
      "format": "date-time",
      "description": "Час останньої перевірки доступності ДПС."
    },
    "tunables": {
      "type": "object",
      "description": "Пороги для значень вище: ширина вікна детектора, поріг degraded і інтервал перевірок.",
      "required": [
        "window_seconds",
        "degraded_latency_ms",
        "probe_interval_seconds"
      ],
      "properties": {
        "window_seconds": {
          "type": "integer",
          "format": "int64",
          "description": "Ширина вікна детектора, у секундах."
        },
        "degraded_latency_ms": {
          "type": "integer",
          "format": "int64",
          "description": "Затримка, від якої відповідь вважається повільною, у мілісекундах."
        },
        "probe_interval_seconds": {
          "type": "integer",
          "format": "int64",
          "description": "Інтервал перевірок, у секундах."
        }
      }
    }
  }
}