{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-load-test-failure-patterns-schema.json",
  "title": "LoadTestFailurePatterns",
  "description": "A load-test run's failures by pattern (wiki designs/load-test-failure-patterns §06a).",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-openapi.json#/components/schemas/LoadTestFailurePatterns",
  "type": "object",
  "required": [
    "runId",
    "groupId",
    "scope",
    "rulesVersion",
    "totalCalls",
    "failedCalls",
    "unclassified",
    "lateStarts",
    "lateStartsPassed",
    "patterns",
    "timeline",
    "callsOverTime",
    "lanes"
  ],
  "properties": {
    "runId": {
      "type": "string"
    },
    "groupId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The group the run was started in; null for a one-config run."
    },
    "scope": {
      "type": "string",
      "enum": [
        "group",
        "lane"
      ]
    },
    "rulesVersion": {
      "type": "integer"
    },
    "totalCalls": {
      "type": "integer"
    },
    "failedCalls": {
      "type": "integer",
      "description": "Calls that did not pass (failed",
      "errored or ended without an outcome).": null
    },
    "unclassified": {
      "type": "integer",
      "description": "Failed calls no rule matched",
      "or not classified yet.": null
    },
    "lateStarts": {
      "type": "integer",
      "description": "Calls whose system under test first spoke later than the late-answer threshold."
    },
    "lateStartsPassed": {
      "type": "integer",
      "description": "Of `lateStarts`",
      "the calls that passed.": null
    },
    "patterns": {
      "type": "array",
      "description": "One entry per pattern with at least one call, most calls first.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "label",
          "owner",
          "description",
          "count",
          "share",
          "byLane",
          "firstSeen",
          "lastSeen",
          "examples"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "enum": [
              "platform",
              "carrier",
              "system-under-test",
              "test-definition",
              "unknown"
            ]
          },
          "description": {
            "type": "string",
            "description": "The pattern's rule in one plain sentence."
          },
          "count": {
            "type": "integer"
          },
          "share": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Fraction of `failedCalls`."
          },
          "byLane": {
            "type": "object",
            "description": "Calls per lane, by lane run id.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "firstSeen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start time of the earliest call in the pattern."
          },
          "lastSeen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start time of the latest call in the pattern."
          }
        }
      }
    },
    "timeline": {
      "type": "object",
      "required": [
        "bucketSecs",
        "buckets"
      ],
      "properties": {
        "bucketSecs": {
          "type": "integer"
        },
        "buckets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "t",
              "inFlight",
              "counts"
            ],
            "properties": {
              "t": {
                "type": "string",
                "format": "date-time",
                "description": "The bucket's start."
              },
              "inFlight": {
                "type": "integer",
                "description": "Calls in progress at any point in the bucket."
              },
              "counts": {
                "type": "object",
                "description": "Failed calls started in the bucket, per pattern id.",
                "additionalProperties": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "callsOverTime": {
      "type": "object",
      "description": "Calls over the run, for a chart. Buckets start at the earliest call start; the size is the smallest of 5, 15, 30, 60 and 300 seconds that keeps the run within 2880 buckets (a longer run is cut). An empty run gives bucketSecs 5 and no buckets.",
      "required": [
        "bucketSecs",
        "buckets"
      ],
      "properties": {
        "bucketSecs": {
          "type": "integer",
          "enum": [
            5,
            15,
            30,
            60,
            300
          ]
        },
        "buckets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "t",
              "sent",
              "inFlight"
            ],
            "properties": {
              "t": {
                "type": "integer",
                "minimum": 0,
                "description": "The bucket's start",
                "in seconds from the earliest call start.": null
              },
              "sent": {
                "type": "integer",
                "description": "Calls whose start falls in the bucket [t, t + bucketSecs)."
              },
              "inFlight": {
                "type": "integer",
                "description": "Calls in flight at the bucket's start (started at or before t, ended after t). A call with no end time is never in flight at a bucket start."
              }
            }
          }
        }
      }
    },
    "lanes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "runId",
          "name"
        ],
        "properties": {
          "runId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    }
  }
}