{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:ledgermath:api:v1:series",
  "title": "LedgerMath data API, version 1: one Series",
  "description": "v1/series/<id>.json: one Series, its summary and its newest Runs. A Series is the Runs of one benchmark, parameter set (params), build, instance type and Availability Zone ID. Under derivations, keyed <method name>_v<version>, is each Method's Derivation of it, at the same paths and in the same words as LedgerMath's Method writes it, with the Method's own definitions beside it: the percentiles, the groups its split facts make and their facts and figures, how often each dump section changed, how many Runs it counts and does not, and the points of the newest Runs (newest_points; as many as newest_runs says). What grows with every Run is not here: every Run's point, and what differed between consecutive Runs, is in the file of the month the Run started in, which months lists with its address, and the Series' points are those of its month files, oldest month first. The lists of Run ids behind each percentile and in each group are not repeated either; each is recovered from those points by the rule its field's description gives. So the number of points this file holds is bounded, by newest_runs; its summaries still grow with what the data hold: a group for each new combination of the machine's split facts, a value for each new distinct value of a request fact, an entry in months for each month. Each point also gives the sha256 of its Run file and the addresses of its evidence: the Run file (evidence) and its boot's summary (boot_summary). Numbers are exactly as the Derivation holds them; a duration is in nanoseconds of the Run's clock unless its field's name says otherwise. The file changes when the Series gains a Run, a Method first applies to it or a Method's words change, or a boot summary of one of its Runs arrives (that month file's sha256 changes, and the point too when it is a newest one), and when LedgerMath changes how the files are written (the layout of v1/index.json increases). Version 1 only ever gains fields: a field, once in a v1 file, keeps its name, its type and its meaning, and a reader ignores any field it does not know, which is why no object in this schema forbids members it does not list. A new Method, or a new version of one, is a new key beside the old ones. A change that would break a reader is published as v2, beside v1.",
  "type": "object",
  "required": ["schema", "schema_url", "index", "id", "url", "benchmark", "params", "build", "instance_type", "availability_zone_id", "runs", "oldest_run_started_at", "newest_run_started_at", "newest_runs", "months", "derivations"],
  "properties": {
    "schema": { "description": "What this file is, and which version of its shape.", "const": "ledgermath.api.series/1" },
    "schema_url": { "description": "The address of this schema.", "$ref": "#/$defs/url" },
    "index": { "description": "The address of the table of contents, v1/index.json.", "$ref": "#/$defs/url" },
    "id": { "description": "The Series' id: the first 12 hex digits of the sha256 of its key (benchmark, params, build, instance type, zone ID) as canonical JSON.", "type": "string", "pattern": "^[0-9a-f]{12}$" },
    "url": { "description": "This file's own address.", "$ref": "#/$defs/url" },
    "benchmark": { "description": "The benchmark's name, as its Runs give it.", "type": "string" },
    "params": {
      "description": "The parameter set, as each Run was given it (LM_PARAM_*).",
      "type": "object",
      "additionalProperties": { "description": "One parameter's value, under the parameter's name, as each Run was given it.", "anyOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] }
    },
    "build": { "description": "The named build of the benchmark (static, dynamic).", "type": "string" },
    "instance_type": { "description": "The EC2 instance type, as the provider names it.", "anyOf": [{ "type": "string" }, { "type": "null" }] },
    "availability_zone_id": { "description": "The Availability Zone ID, as the provider names it.", "anyOf": [{ "type": "string" }, { "type": "null" }] },
    "runs": { "description": "Runs in the Series, counted or not.", "type": "integer", "minimum": 1 },
    "boots": { "description": "How many boots its Runs were made on: the distinct boots its points name, counted or not. A boot is one fresh machine; each point names its boot (boot) and links its summary (boot_summary). Written since layout 2 (the layout of v1/index.json); a file written before it lacks it.", "type": "integer", "minimum": 1 },
    "oldest_run_started_at": { "description": "When its oldest Run started.", "$ref": "#/$defs/time" },
    "newest_run_started_at": { "description": "When its newest Run started: the moment a citation of the Series as it stands names.", "$ref": "#/$defs/time" },
    "newest_runs": { "description": "How many of the Series' newest Runs each Method's newest_points holds: this many, or every Run when the Series has fewer. The same in every Series file.", "type": "integer", "minimum": 1 },
    "months": {
      "description": "Every month in which a Run of the Series started (UTC, by the Run's start), oldest first, each with the address of its file, and the sha256 and size of the file as it is now. A month's file holds every point of its Runs. For a given layout (the layout of v1/index.json), a month file's bytes change only when (a) a Run that started in that month is added, (b) a boot summary that was missing arrives, (c) a Run arrives late, having started before a Run of the Series already in the files, in that month or an earlier one, or (d) a Method first applies to the Series; otherwise they do not change. These four are the only causes for a given layout: layout increases when LedgerMath changes how the files are written, and only then may a file's bytes change without one of them. A past month is therefore not immutable: each entry of the Series file's months gives its month file's sha256 and size in bytes, so a reader holding a copy can tell whether it is current, and fetches the file again only when the sha256 differs. A Series file and a month file fetched together can still be from different updates of the files: a cache may hold one of them from before the other changed, and an update that stopped halfway leaves them so until the next one. So a reader checks the sha256 of every month file it fetches against the one its Series file lists; on a mismatch, it fetches the Series file again, then the month file, and compares again; while they still differ, it uses neither, and tries again later.",
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/month" }
    },
    "derivations": {
      "description": "Each Method's Derivation of the Series, keyed <method name>_v<version>. Method series v1 derives every Series; Method requests v1 only those whose samples are requests, and its key is absent from the others.",
      "type": "object",
      "required": ["series_v1"],
      "properties": {
        "series_v1": { "$ref": "#/$defs/series_v1" },
        "requests_v1": { "$ref": "#/$defs/requests_v1" }
      }
    }
  },
  "$defs": {
    "url": { "description": "An address: an absolute URL starting http:// or https://.", "type": "string", "pattern": "^https?://" },
    "time": { "description": "UTC, to the nanosecond, as the Run records it.", "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z$" },
    "number_or_null": { "description": "A number, or null.", "anyOf": [{ "type": "number" }, { "type": "null" }] },
    "string_or_null": { "description": "A string, or null.", "anyOf": [{ "type": "string" }, { "type": "null" }] },
    "definitions": { "description": "How each number is made, in the Method's words, by name.", "type": "object", "additionalProperties": { "description": "One definition, in the Method's words, under the name of what it defines.", "type": "string" } },
    "split_fact": {
      "description": "A fact the Runs record, by name, with the Method's words for it: under split_on, a fact a Series is split into groups on, and where it is read from; under not_split_on, one or more Run fields or dump sections that do not split a Series, and why.",
      "type": "object",
      "required": ["fact", "what"],
      "properties": {
        "fact": { "description": "The fact's name. In split_on, the name under which a group's facts give its value; in not_split_on, the Run fields or dump sections it names, separated by commas when there are more than one.", "type": "string" },
        "what": { "description": "In the Method's words: in split_on, what the fact is and where it is read from; in not_split_on, why it does not split a Series.", "type": "string" },
        "section": { "description": "The dump section it is read from, if it is.", "type": "string" }
      }
    },
    "left_out": {
      "description": "Something the Method leaves out of a dump section before it compares the section for the split: the section, and what is left out and why, in the Method's words.",
      "type": "object",
      "required": ["section", "what", "why"],
      "properties": {
        "section": { "description": "The dump section it is left out of.", "type": "string" },
        "what": { "description": "What is left out of the section, in the Method's words.", "type": "string" },
        "why": { "description": "Why it is left out, in the Method's words.", "type": "string" }
      }
    },
    "facts": {
      "description": "A group's split facts and their values, by the fact's name: for binary and runner, a blob's sha256:<hex>; for samples, the sample count; for image, the image ID; for a dump section something is left out of (cpuid, lscpu, kernel), canonical-json-sha256:<hex>, the sha256 of what remains; for any other section (sys_cpu, process, packages), its blob's sha256:<hex>. Null for a section the before-dump lacks, or an image ID the Run lacks.",
      "type": "object",
      "additionalProperties": { "description": "One split fact's value, under the fact's name as split_on gives it; null when the Runs do not record it (a dump section their before-dumps lack, no image ID).", "anyOf": [{ "type": "string" }, { "type": "number" }, { "type": "null" }] }
    },
    "month": {
      "description": "One month in which a Run of the Series started: the address of its month file, how many of the Series' Runs started in it and when the oldest and newest of them did, and the month file's sha256 and size as it is now.",
      "type": "object",
      "required": ["month", "url", "runs", "oldest_run_started_at", "newest_run_started_at", "sha256", "bytes"],
      "properties": {
        "month": { "description": "The month, yyyy-mm, UTC.", "type": "string", "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$" },
        "url": { "description": "The address of the month's file, v1/series/<id>/<yyyy-mm>.json.", "$ref": "#/$defs/url" },
        "runs": { "description": "Runs of the Series that started that month, counted or not.", "type": "integer", "minimum": 1 },
        "oldest_run_started_at": { "description": "When the oldest of them started.", "$ref": "#/$defs/time" },
        "newest_run_started_at": { "description": "When the newest of them started.", "$ref": "#/$defs/time" },
        "sha256": { "description": "The sha256 of the month file's bytes as they are now, in hex. A reader holding a copy of the month file compares its sha256 with this one, and fetches the file again only when they differ; a month file just fetched that does not match it is from another update than this Series file, and months says what to do.", "type": "string", "pattern": "^[0-9a-f]{64}$" },
        "bytes": { "description": "The month file's size in bytes, as it is now.", "type": "integer", "minimum": 1 }
      }
    },
    "point_run": { "description": "The Run's id.", "type": "string" },
    "point_path": { "description": "The Run file's path, runs/<yyyy>/<mm>/<dd>/<id>.json: the name LedgerMath gives it, and its address under the API's base (evidence).", "type": "string", "pattern": "^runs/[0-9]{4}/[0-9]{2}/[0-9]{2}/[^/]+\\.json$" },
    "point_sha256": { "description": "The sha256 of the Run file's bytes, in hex: what the Derivation cites.", "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "point_evidence": { "description": "The Run file's address.", "$ref": "#/$defs/url" },
    "point_boot_summary": {
      "description": "The address of the summary of the boot the Run was part of, which accounts for every execution the boot was to run; null when LedgerMath held no summary of that boot when the file was made. A summary that arrives later turns it into the address, and is one of the four causes for which a month file changes.",
      "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }]
    },
    "point_started_at": { "description": "When the Run started.", "$ref": "#/$defs/time" },
    "point_boot": { "description": "The boot's id.", "type": "string" },
    "point_group": { "description": "The group its split facts put it in.", "type": "string" },
    "point_counted": { "description": "Whether the Method counts the Run. A Run it does not count is shown, with why, and is left out of the Method's statistics.", "type": "boolean" },
    "point_failure": { "description": "Why it is not counted, or null: the first 10 of its reasons, each cut to its first 500 characters, joined by \"; \", then how many more there are.", "$ref": "#/$defs/string_or_null" },

    "method_series": {
      "description": "The Method, by name and version: series, version 1.",
      "type": "object",
      "required": ["name", "version"],
      "properties": { "name": { "description": "The Method's name: series.", "const": "series" }, "version": { "description": "The Method's version: 1.", "const": 1 } }
    },
    "series_v1": {
      "description": "Method series, version 1: one number per Run, and the 5th, 50th and 95th percentiles across Runs, for the Series and for each group. Its points are in the month files, under the same key.",
      "type": "object",
      "required": ["method", "definitions", "split_on", "left_out", "not_split_on", "counted_runs", "failed_runs", "percentiles", "groups", "sections", "newest_points"],
      "properties": {
        "method": { "$ref": "#/$defs/method_series" },
        "definitions": { "$ref": "#/$defs/definitions" },
        "split_on": { "description": "The facts a Series is split into groups on, in order.", "type": "array", "items": { "$ref": "#/$defs/split_fact" } },
        "left_out": { "description": "What is left out of a dump section before it is compared for the split, and why.", "type": "array", "items": { "$ref": "#/$defs/left_out" } },
        "not_split_on": { "description": "Facts the Runs record that do not split a Series, and why.", "type": "array", "items": { "$ref": "#/$defs/split_fact" } },
        "counted_runs": { "description": "Runs this Method counts.", "type": "integer", "minimum": 0 },
        "failed_runs": { "description": "Runs it does not count: shown in their month's file with why, in no percentile.", "type": "integer", "minimum": 0 },
        "percentiles": { "description": "Across every counted Run of the Series, whatever its group.", "$ref": "#/$defs/series_percentiles" },
        "groups": { "description": "The groups its split facts make of the Series' Runs, in the order each first appears.", "type": "array", "items": { "$ref": "#/$defs/series_group" } },
        "sections": { "description": "How often each dump section's hash changed in this Series.", "type": "array", "items": { "$ref": "#/$defs/section_counts" } },
        "newest_points": { "description": "The points of the Series' newest Runs (newest_runs of them, or all when there are fewer), in time order: the same points, value for value, as their month's file holds.", "type": "array", "items": { "$ref": "#/$defs/series_point" } }
      }
    },
    "series_point": {
      "description": "One Run on the Series' chart, with the sha256 of its Run file and the addresses of its evidence.",
      "type": "object",
      "required": ["run", "path", "sha256", "evidence", "boot_summary", "started_at", "boot", "group", "counted", "failure", "samples", "time_per_repetition_ns", "bytes_per_repetition", "bytes_per_second"],
      "properties": {
        "run": { "$ref": "#/$defs/point_run" },
        "path": { "$ref": "#/$defs/point_path" },
        "sha256": { "$ref": "#/$defs/point_sha256" },
        "evidence": { "$ref": "#/$defs/point_evidence" },
        "boot_summary": { "$ref": "#/$defs/point_boot_summary" },
        "started_at": { "$ref": "#/$defs/point_started_at" },
        "boot": { "$ref": "#/$defs/point_boot" },
        "group": { "$ref": "#/$defs/point_group" },
        "counted": { "$ref": "#/$defs/point_counted" },
        "failure": { "$ref": "#/$defs/point_failure" },
        "samples": {
          "description": "Its counted samples, in stream order; empty when it is not counted.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["sample", "ns", "repetitions", "ns_per_repetition"],
            "properties": {
              "sample": { "description": "The sample's number in the stream.", "type": "integer" },
              "ns": { "description": "sample_ended.t minus sample_started.t, in nanoseconds of the Run's clock.", "type": "number" },
              "repetitions": { "description": "How many repetitions of the measured work the sample holds, as its sample_started gives it.", "type": "number" },
              "ns_per_repetition": { "description": "ns / repetitions.", "type": "number" }
            }
          }
        },
        "time_per_repetition_ns": { "description": "The median of its samples' ns_per_repetition: the Run's one number, 0 or more. Null when it is not counted; and null when it is infinite, past a double's range, which JSON cannot hold: when it is the mean of its two middle samples' ns_per_repetition and their sum overflows (both near the top of a double's range; no real clock comes near). Such a Run is still counted, and still among the Runs of its Series' and group's time_per_repetition_ns percentiles.", "$ref": "#/$defs/number_or_null" },
        "bytes_per_repetition": { "description": "As the benchmark observed it, a positive number. Null when it is not counted, or when the benchmark observed no bytes per repetition.", "$ref": "#/$defs/number_or_null" },
        "bytes_per_second": {
          "description": "bytes_per_repetition × 10^9 / time_per_repetition_ns. Null when either is null; and null when the quotient is infinite, past a double's range, which JSON cannot hold: chiefly a counted Run that observed a finite bytes per repetition above 0 and whose time per repetition is 0 (its median sample ended at the clock read it started at). Such a Run is still counted, and still among the Runs of its Series' and group's bytes_per_second percentiles.",
          "$ref": "#/$defs/number_or_null"
        }
      }
    },
    "stat": {
      "description": "Percentiles of time per repetition across counted Runs. The Runs behind it are not listed: they are every counted point of the Series (for a group's, the points with the group's letter, counted or not, and of those the counted ones), in order of start, then Run id, as the month files hold them. Every counted Run has a time per repetition. A counted Run's time per repetition is infinite, past a double's range, when it is the mean of its two middle samples' ns_per_repetition and their sum overflows (both near the top of a double's range; no real clock comes near): JSON cannot hold it, so its point shows null, and it is counted here all the same; a percentile taken from it, or interpolated towards it, is null.",
      "type": "object",
      "required": ["count", "p5", "p50", "p95"],
      "properties": {
        "count": { "description": "Counted Runs.", "type": "integer", "minimum": 1 },
        "p5": { "description": "The 5th percentile of the counted Runs' times per repetition (count of them), in nanoseconds, by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, an infinite time per repetition.", "$ref": "#/$defs/number_or_null" },
        "p50": { "description": "The 50th percentile of the counted Runs' times per repetition (count of them), in nanoseconds, by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, an infinite time per repetition.", "$ref": "#/$defs/number_or_null" },
        "p95": { "description": "The 95th percentile of the counted Runs' times per repetition (count of them), in nanoseconds, by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, an infinite time per repetition.", "$ref": "#/$defs/number_or_null" }
      }
    },
    "bytes_per_second_stat": {
      "description": "Percentiles of bytes per second across the counted Runs that observed a finite bytes per repetition above 0. The Runs behind it are not listed: they are every counted point of the Series whose bytes_per_repetition is not null (for a group's, the points with the group's letter, counted or not, and of those the counted ones whose bytes_per_repetition is not null), in order of start, then Run id, as the month files hold them. A Run among them whose bytes per second is infinite, past a double's range (chiefly one whose time per repetition is 0), cannot have it written in JSON: its point shows null, it is counted here all the same, and a percentile taken from it, or interpolated towards it, is null.",
      "type": "object",
      "required": ["count", "p5", "p50", "p95"],
      "properties": {
        "count": { "description": "Counted Runs that observed a finite bytes per repetition above 0, a Run with a bytes per second that is not a finite number included.", "type": "integer", "minimum": 1 },
        "p5": { "description": "The 5th percentile of the bytes per second of the counted Runs that observed a finite bytes per repetition above 0 (count of them), by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, a bytes per second that is not a finite number.", "$ref": "#/$defs/number_or_null" },
        "p50": { "description": "The 50th percentile of the bytes per second of the counted Runs that observed a finite bytes per repetition above 0 (count of them), by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, a bytes per second that is not a finite number.", "$ref": "#/$defs/number_or_null" },
        "p95": { "description": "The 95th percentile of the bytes per second of the counted Runs that observed a finite bytes per repetition above 0 (count of them), by linear interpolation between closest ranks (R type 7). Null when it is infinite or undefined: taken from, or interpolated towards, a bytes per second that is not a finite number.", "$ref": "#/$defs/number_or_null" }
      }
    },
    "series_percentiles": {
      "description": "The 5th, 50th and 95th percentiles of time per repetition and of bytes per second across a set of counted Runs: the Series', or one group's. time_per_repetition_ns is null when no Run counts; bytes_per_second is null when no counted Run observed a finite bytes per repetition above 0.",
      "type": "object",
      "required": ["time_per_repetition_ns", "bytes_per_second"],
      "properties": {
        "time_per_repetition_ns": { "description": "Nanoseconds per repetition: each Run's median over its counted samples.", "anyOf": [{ "$ref": "#/$defs/stat" }, { "type": "null" }] },
        "bytes_per_second": { "description": "Bytes per second: each Run's bytes per repetition × 10^9 / its time per repetition in nanoseconds.", "anyOf": [{ "$ref": "#/$defs/bytes_per_second_stat" }, { "type": "null" }] }
      }
    },
    "series_group": {
      "description": "The Runs whose split facts are all equal. Lettered A, B, C… in the order each first appears; groups may interleave in time. Its Runs are not listed: they are the points whose group is its id, counted or not, in order of start, then Run id, as the month files hold them. How many there are and when the oldest and newest started are given here, taken from those points: what its percentiles rest on (written since layout 2, the layout of v1/index.json; a file written before it lacks them).",
      "type": "object",
      "required": ["id", "facts", "percentiles"],
      "properties": {
        "id": { "description": "The group's letters: A, B, …, Z, AA, AB, … in the order each group first appears in the Series. Each of its points gives them as group.", "type": "string" },
        "facts": { "$ref": "#/$defs/facts" },
        "counted_runs": { "$ref": "#/$defs/group_counted_runs" },
        "failed_runs": { "$ref": "#/$defs/group_failed_runs" },
        "oldest_run_started_at": { "$ref": "#/$defs/group_oldest_run_started_at" },
        "newest_run_started_at": { "$ref": "#/$defs/group_newest_run_started_at" },
        "percentiles": { "$ref": "#/$defs/series_percentiles" }
      }
    },
    "group_counted_runs": { "description": "Its Runs the Method counts: its points with counted true.", "type": "integer", "minimum": 0 },
    "group_failed_runs": { "description": "Its Runs the Method does not count: its points with counted false. Its Runs, counted or not, number counted_runs and failed_runs together.", "type": "integer", "minimum": 0 },
    "group_oldest_run_started_at": { "description": "When its oldest Run started, counted or not.", "$ref": "#/$defs/time" },
    "group_newest_run_started_at": { "description": "When its newest Run started, counted or not.", "$ref": "#/$defs/time" },
    "section_counts": {
      "description": "One dump section, and how often its hash changed in the Series: within a Run, between its before-dump and after-dump, and between consecutive Runs' before-dumps.",
      "type": "object",
      "required": ["section", "runs", "changed_within_run", "pairs", "changed_between_runs", "split_on"],
      "properties": {
        "section": { "description": "The dump section's name.", "type": "string" },
        "runs": { "description": "Runs whose before-dump or after-dump holds the section.", "type": "integer", "minimum": 0 },
        "changed_within_run": { "description": "Of those, the Runs whose before-dump and after-dump hold different hashes for it, or only one of which holds it.", "type": "integer", "minimum": 0 },
        "pairs": { "description": "Pairs of consecutive Runs in the Series at least one of whose before-dumps holds the section. A pair neither of whose before-dumps holds it is not counted for it, so the count can differ from section to section.", "type": "integer", "minimum": 0 },
        "changed_between_runs": { "description": "Of those, the pairs whose before-dumps hold different hashes for it, or only one of which holds it.", "type": "integer", "minimum": 0 },
        "split_on": { "description": "The split fact read from the section, or null.", "$ref": "#/$defs/string_or_null" }
      }
    },

    "method_requests": {
      "description": "The Method, by name and version: requests, version 1.",
      "type": "object",
      "required": ["name", "version"],
      "properties": { "name": { "description": "The Method's name: requests.", "const": "requests" }, "version": { "description": "The Method's version: 1.", "const": 1 } }
    },
    "requests_v1": {
      "description": "Method requests, version 1: each phase of a request, across the requests, within each Run and pooled across Runs, for the Series and for each group. Its points are in the month files, under the same key.",
      "type": "object",
      "required": ["method", "definitions", "phases", "percentiles", "histogram", "request_facts", "split_on", "left_out", "counted_runs", "failed_runs", "recorded", "pool", "groups", "newest_points"],
      "properties": {
        "method": { "$ref": "#/$defs/method_requests" },
        "definitions": { "$ref": "#/$defs/definitions" },
        "phases": {
          "description": "The phases of a request, each an interval between two of its events, in nanoseconds of the Run's clock.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["phase", "name", "interval"],
            "properties": {
              "phase": { "description": "The phase's key, as each phase's statistics are keyed: dns, connect, tls, send, first_byte, headers, body or total.", "type": "string" },
              "name": { "description": "The phase in words, such as name lookup.", "type": "string" },
              "interval": { "description": "Which two of the request's event timestamps the phase is the difference of, in words, and over which connections it applies.", "type": "string" }
            }
          }
        },
        "percentiles": {
          "description": "The percentiles reported, and the fewest requests that support each.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["name", "per_mille", "least_requests"],
            "properties": {
              "name": { "description": "The percentile's name, as the statistics are keyed: p50, p90, p95, p99 or p99.9.", "type": "string" },
              "per_mille": { "description": "The percentile as a whole number per mille: 500 for p50, 999 for p99.9.", "type": "integer" },
              "least_requests": { "description": "The fewest requests that support it: at least one request is then expected above it.", "type": "integer" }
            }
          }
        },
        "histogram": {
          "description": "How each phase's times are tallied in fixed bins, the same for every Run, so that the tallies of different Runs add: a pooled percentile is read from the summed bins.",
          "type": "object",
          "required": ["bins_per_doubling", "exact_below_ns", "precision", "definition"],
          "properties": {
            "bins_per_doubling": { "description": "How many bins each doubling of time is cut into, from exact_below_ns on.", "type": "integer" },
            "exact_below_ns": { "description": "Below this many nanoseconds, every nanosecond is a bin of its own.", "type": "integer" },
            "precision": { "description": "A pooled percentile is within this fraction of the exact percentile of the same requests.", "type": "number" },
            "definition": { "description": "How a time's bin is found, in the Method's words.", "type": "string" }
          }
        },
        "request_facts": {
          "description": "The facts each request records of its connection or of itself.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["fact", "what"],
            "properties": {
              "fact": { "description": "The request fact's name, as a pool's breakdowns (by) and values (facts) name it.", "type": "string" },
              "what": { "description": "What the request fact is and which event it is read from, in the Method's words.", "type": "string" }
            }
          }
        },
        "split_on": { "description": "Method series v1's split facts, which give the same groups.", "type": "array", "items": { "$ref": "#/$defs/split_fact" } },
        "left_out": { "description": "Method series v1's: what is left out of a dump section before it is compared for the split, and why.", "type": "array", "items": { "$ref": "#/$defs/left_out" } },
        "counted_runs": { "description": "Runs this Method counts (exit 0, or 4 with failed requests).", "type": "integer", "minimum": 0 },
        "failed_runs": { "description": "Runs it does not count: shown in their month's file with why, left out of its request statistics.", "type": "integer", "minimum": 0 },
        "recorded": { "$ref": "#/$defs/recorded" },
        "pool": { "description": "Every succeeded request of the Series' counted Runs, whatever their group.", "$ref": "#/$defs/pool" },
        "groups": {
          "description": "Its groups: Method series v1's, the same letters for the same Runs, in the order each first appears.",
          "type": "array",
          "items": {
            "description": "Method series v1's group of the same letter: the same Runs. Its Runs are not listed: they are the points whose group is its id, counted or not, in order of start, then Run id, as the month files hold them. How many there are and when the oldest and newest started are given here, taken from this Method's points, which count Runs as this Method does: what its pooled figures rest on (written since layout 2, the layout of v1/index.json; a file written before it lacks them).",
            "type": "object",
            "required": ["id", "facts", "pool"],
            "properties": {
              "id": { "description": "The group's letters, series v1's for the same Runs. Each of its points gives them as group.", "type": "string" },
              "facts": { "$ref": "#/$defs/facts" },
              "counted_runs": { "$ref": "#/$defs/group_counted_runs" },
              "failed_runs": { "$ref": "#/$defs/group_failed_runs" },
              "oldest_run_started_at": { "$ref": "#/$defs/group_oldest_run_started_at" },
              "newest_run_started_at": { "$ref": "#/$defs/group_newest_run_started_at" },
              "pool": { "$ref": "#/$defs/pool" }
            }
          }
        },
        "newest_points": { "description": "The points of the Series' newest Runs (newest_runs of them, or all when there are fewer), in time order: the same points, value for value, as their month's file holds.", "type": "array", "items": { "$ref": "#/$defs/requests_point" } }
      }
    },
    "recorded": {
      "description": "What the Series' Runs record beside their requests, counted or not: words for a reader, no figure.",
      "type": "object",
      "required": ["regions", "services", "without_service"],
      "properties": {
        "regions": {
          "description": "The box's Region as each Run's provider names it, with how many Runs.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["value", "runs"],
            "properties": {
              "value": { "description": "The Region, as the provider names it; null for the Runs whose provider names none.", "$ref": "#/$defs/string_or_null" },
              "runs": { "description": "How many of the Series' Runs give this value, counted or not.", "type": "integer" }
            }
          }
        },
        "services": {
          "description": "The Service each Run names, with its inputs that are not secret, as delivered, and how many Runs.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["name", "inputs", "runs"],
            "properties": {
              "name": { "description": "The Service's name, as the Runs give it, such as s3_fixtures.", "type": "string" },
              "inputs": { "description": "Its inputs that are not secret, by name, exactly as delivered to the binary.", "type": "object", "additionalProperties": { "description": "One input's value, exactly as delivered.", "type": "string" } },
              "runs": { "description": "How many of the Series' Runs name this Service with these inputs, counted or not.", "type": "integer" }
            }
          }
        },
        "without_service": { "description": "Runs that name no Service.", "type": "integer" }
      }
    },
    "request_stats": {
      "description": "One phase over a set of requests, in nanoseconds: the count of requests, the least and greatest time, and each percentile the count supports (null when it does not), with how many requests are ranked at or above each one reported.",
      "type": "object",
      "required": ["count", "min", "max", "p50", "p90", "p95", "p99", "p99.9", "at_or_above"],
      "properties": {
        "count": { "description": "How many requests the figures are of: those of the set that succeeded and had this phase.", "type": "integer", "minimum": 0 },
        "min": { "description": "The least of their times, in nanoseconds, exactly.", "type": "number" },
        "max": { "description": "The greatest of their times, in nanoseconds, exactly.", "type": "number" },
        "p50": { "description": "The 50th percentile of their times, in nanoseconds; null when count is under 2, too few to support it. In one Run's own statistics, interpolated between its sorted times; in pooled statistics, read from the summed histogram, within 1/128 of the exact percentile.", "$ref": "#/$defs/number_or_null" },
        "p90": { "description": "The 90th percentile of their times, in nanoseconds; null when count is under 10, too few to support it. In one Run's own statistics, interpolated between its sorted times; in pooled statistics, read from the summed histogram, within 1/128 of the exact percentile.", "$ref": "#/$defs/number_or_null" },
        "p95": { "description": "The 95th percentile of their times, in nanoseconds; null when count is under 20, too few to support it. In one Run's own statistics, interpolated between its sorted times; in pooled statistics, read from the summed histogram, within 1/128 of the exact percentile.", "$ref": "#/$defs/number_or_null" },
        "p99": { "description": "The 99th percentile of their times, in nanoseconds; null when count is under 100, too few to support it. In one Run's own statistics, interpolated between its sorted times; in pooled statistics, read from the summed histogram, within 1/128 of the exact percentile.", "$ref": "#/$defs/number_or_null" },
        "p99.9": { "description": "The 99.9th percentile of their times, in nanoseconds; null when count is under 1000, too few to support it. In one Run's own statistics, interpolated between its sorted times; in pooled statistics, read from the summed histogram, within 1/128 of the exact percentile.", "$ref": "#/$defs/number_or_null" },
        "at_or_above": { "$ref": "#/$defs/at_or_above" }
      }
    },
    "at_or_above": {
      "description": "For each percentile reported, how many requests are ranked at or above it (ties counted by rank).",
      "type": "object",
      "properties": {
        "p50": { "description": "How many requests are ranked at or above the 50th percentile; absent when it is not reported.", "type": "integer" },
        "p90": { "description": "How many requests are ranked at or above the 90th percentile; absent when it is not reported.", "type": "integer" },
        "p95": { "description": "How many requests are ranked at or above the 95th percentile; absent when it is not reported.", "type": "integer" },
        "p99": { "description": "How many requests are ranked at or above the 99th percentile; absent when it is not reported.", "type": "integer" },
        "p99.9": { "description": "How many requests are ranked at or above the 99.9th percentile; absent when it is not reported.", "type": "integer" }
      }
    },
    "phase_stats": {
      "description": "Each phase's statistics, by phase; a phase no request had is absent (dns, connect and tls over a kept connection).",
      "type": "object",
      "properties": {
        "dns": { "$ref": "#/$defs/request_stats" },
        "connect": { "$ref": "#/$defs/request_stats" },
        "tls": { "$ref": "#/$defs/request_stats" },
        "send": { "$ref": "#/$defs/request_stats" },
        "first_byte": { "$ref": "#/$defs/request_stats" },
        "headers": { "$ref": "#/$defs/request_stats" },
        "body": { "$ref": "#/$defs/request_stats" },
        "total": { "$ref": "#/$defs/request_stats" }
      }
    },
    "pooled_phase": {
      "description": "One phase pooled: its statistics, read from the summed histogram, and the histogram itself.",
      "type": "object",
      "required": ["count", "min", "max", "p50", "p90", "p95", "p99", "p99.9", "at_or_above", "histogram"],
      "properties": {
        "count": { "description": "How many requests the figures are of: those of the set that succeeded and had this phase.", "type": "integer", "minimum": 0 },
        "min": { "description": "The least of their times, in nanoseconds, exactly.", "type": "number" },
        "max": { "description": "The greatest of their times, in nanoseconds, exactly.", "type": "number" },
        "p50": { "description": "The 50th percentile of their times, in nanoseconds, read from the summed histogram: within 1/128 of the exact percentile of the same requests. Null when count is under 2, too few to support it.", "$ref": "#/$defs/number_or_null" },
        "p90": { "description": "The 90th percentile of their times, in nanoseconds, read from the summed histogram: within 1/128 of the exact percentile of the same requests. Null when count is under 10, too few to support it.", "$ref": "#/$defs/number_or_null" },
        "p95": { "description": "The 95th percentile of their times, in nanoseconds, read from the summed histogram: within 1/128 of the exact percentile of the same requests. Null when count is under 20, too few to support it.", "$ref": "#/$defs/number_or_null" },
        "p99": { "description": "The 99th percentile of their times, in nanoseconds, read from the summed histogram: within 1/128 of the exact percentile of the same requests. Null when count is under 100, too few to support it.", "$ref": "#/$defs/number_or_null" },
        "p99.9": { "description": "The 99.9th percentile of their times, in nanoseconds, read from the summed histogram: within 1/128 of the exact percentile of the same requests. Null when count is under 1000, too few to support it.", "$ref": "#/$defs/number_or_null" },
        "at_or_above": { "$ref": "#/$defs/at_or_above" },
        "histogram": {
          "description": "[bin, count] in bin order, no empty bin; the requests' histogram definition says which times each bin holds.",
          "type": "array",
          "items": { "type": "array", "prefixItems": [{ "type": "integer" }, { "type": "integer" }], "items": false, "minItems": 2 }
        }
      }
    },
    "failure_count": {
      "description": "Failures of one kind: where (phase), what kind, and how many. Under failures they are requests that failed; under setups_failed they are setups of a kept connection that failed outside any sample, whose phase and kind are their connection_failed event's phase and error.",
      "type": "object",
      "required": ["phase", "kind", "count"],
      "properties": {
        "phase": { "description": "For a request that failed: record when the binary withheld one of its lines (a withheld certificate line, its withheld_event the string certificate, is set aside first, like a certificate event, and is no failure); otherwise request_failed.phase, or response for a complete response whose status is not 2xx. For a setup of a kept connection that failed (setups_failed): the phase its connection_failed event gives.", "type": "string" },
        "kind": { "description": "For a request that failed: for record, from the first withheld line in stream order that is not a certificate's, line_withheld_<event> when it names the event it replaced as a word of a-z, 0-9 and _ starting with a letter, and line_withheld when it does not; otherwise request_failed.error, or status_<code>. For a setup of a kept connection that failed (setups_failed): the error its connection_failed event gives.", "type": "string" },
        "count": { "description": "How many failed in that phase with that kind of failure, 1 or more.", "type": "integer", "minimum": 1 }
      }
    },
    "failures": { "description": "Failures counted by where and what kind: each entry gives a phase, a kind of failure, and how many failed with both.", "type": "array", "items": { "$ref": "#/$defs/failure_count" } },
    "pool_summary": {
      "description": "The pooled figures as they stood through one Run: the counted Runs that started at or before it. What a citation of an earlier moment is checked against.",
      "type": "object",
      "required": ["runs", "requests", "failed", "phases", "failures"],
      "properties": {
        "runs": { "description": "How many counted Runs it pools.", "type": "integer", "minimum": 0 },
        "requests": { "description": "How many succeeded requests it pools.", "type": "integer", "minimum": 0 },
        "failed": { "description": "How many of its counted requests failed, never timed.", "type": "integer", "minimum": 0 },
        "phases": { "$ref": "#/$defs/phase_stats" },
        "failures": { "description": "Its failed requests, by where and what kind of failure, with how many.", "$ref": "#/$defs/failures" }
      }
    },
    "pool": {
      "description": "Every succeeded request of a set of counted Runs, pooled.",
      "type": "object",
      "required": ["runs", "requests", "failed", "phases", "failures", "setups_failed", "by", "facts"],
      "properties": {
        "runs": { "description": "Counted Runs.", "type": "integer", "minimum": 0 },
        "requests": { "description": "Succeeded requests.", "type": "integer", "minimum": 0 },
        "failed": { "description": "Failed requests, never timed.", "type": "integer", "minimum": 0 },
        "phases": {
          "description": "Each phase pooled, by phase; a phase no request had is absent (dns, connect and tls over a kept connection).",
          "type": "object",
          "properties": {
            "dns": { "$ref": "#/$defs/pooled_phase" },
            "connect": { "$ref": "#/$defs/pooled_phase" },
            "tls": { "$ref": "#/$defs/pooled_phase" },
            "send": { "$ref": "#/$defs/pooled_phase" },
            "first_byte": { "$ref": "#/$defs/pooled_phase" },
            "headers": { "$ref": "#/$defs/pooled_phase" },
            "body": { "$ref": "#/$defs/pooled_phase" },
            "total": { "$ref": "#/$defs/pooled_phase" }
          }
        },
        "failures": { "description": "Its counted Runs' failed requests, by where and what kind of failure, with how many.", "$ref": "#/$defs/failures" },
        "setups_failed": { "description": "Setups of a kept connection that failed outside any sample.", "$ref": "#/$defs/failures" },
        "by": {
          "description": "The pooled figures again for the requests that had each value of a request fact, for each fact that took more than one value among the pool's requests.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["fact", "values"],
            "properties": {
              "fact": { "description": "The request fact's name, one that request_facts lists.", "type": "string" },
              "values": {
                "description": "Each value the fact took among the pool's succeeded requests, in order of the value, with the pooled figures of the requests that had it.",
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["value", "runs", "requests", "phases"],
                  "properties": {
                    "value": { "description": "The value, read from each request as request_facts says.", "type": "string" },
                    "runs": { "description": "Counted Runs with at least one succeeded request of this value.", "type": "integer" },
                    "requests": { "description": "How many of the pool's succeeded requests had this value.", "type": "integer" },
                    "phases": { "$ref": "#/$defs/phase_stats" }
                  }
                }
              }
            }
          }
        },
        "facts": {
          "description": "Every value each request fact took among the pool's succeeded requests, a single value included, with how many requests had it.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["fact", "values"],
            "properties": {
              "fact": { "description": "The request fact's name, one that request_facts lists.", "type": "string" },
              "values": {
                "description": "Every value the fact took among the pool's succeeded requests, in order of the value, with how many had it.",
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["value", "requests"],
                  "properties": {
                    "value": { "description": "The value, read from each request as request_facts says.", "type": "string" },
                    "requests": { "description": "How many of the pool's succeeded requests had this value.", "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "requests_point": {
      "description": "One Run of the Series, with the sha256 of its Run file and the addresses of its evidence.",
      "type": "object",
      "required": [
        "run", "path", "sha256", "evidence", "boot_summary", "started_at", "boot", "group", "counted", "failure",
        "exit_code", "counted_requests", "succeeded", "failed", "phases", "failures", "setups_failed", "warmup_failure", "through", "group_through_as_of_run"
      ],
      "properties": {
        "run": { "$ref": "#/$defs/point_run" },
        "path": { "$ref": "#/$defs/point_path" },
        "sha256": { "$ref": "#/$defs/point_sha256" },
        "evidence": { "$ref": "#/$defs/point_evidence" },
        "boot_summary": { "$ref": "#/$defs/point_boot_summary" },
        "started_at": { "$ref": "#/$defs/point_started_at" },
        "boot": { "$ref": "#/$defs/point_boot" },
        "group": { "$ref": "#/$defs/point_group" },
        "counted": { "$ref": "#/$defs/point_counted" },
        "failure": { "$ref": "#/$defs/point_failure" },
        "exit_code": { "description": "The binary's exit code, or null when a signal ended it.", "anyOf": [{ "type": "integer" }, { "type": "null" }] },
        "counted_requests": { "description": "Counted samples in its stream (counted requests); null when there was none to count.", "anyOf": [{ "type": "integer" }, { "type": "null" }] },
        "succeeded": { "description": "Of the counted requests, those that succeeded; 0 for a Run not counted.", "type": "integer", "minimum": 0 },
        "failed": { "description": "Of the counted requests, those that failed; 0 for a Run not counted.", "type": "integer", "minimum": 0 },
        "phases": { "description": "Its own succeeded requests' statistics per phase, exactly; empty for a Run not counted or one whose every request failed.", "$ref": "#/$defs/phase_stats" },
        "failures": { "description": "Its counted requests that failed, by where and what kind of failure, with how many; empty for a Run not counted.", "$ref": "#/$defs/failures" },
        "setups_failed": { "description": "Its setups of a kept connection that failed outside any sample, by where and what kind of failure, with how many; empty for a Run not counted.", "$ref": "#/$defs/failures" },
        "warmup_failure": {
          "description": "How the warmup request failed, or null.",
          "anyOf": [
            {
              "type": "object",
              "required": ["phase", "kind"],
              "properties": {
                "phase": { "description": "Where the warmup request failed, read as a counted request's failure is: its certificate events, and a withheld certificate line (its withheld_event the string certificate), are set aside first; then it is record when the binary withheld any other of its lines; otherwise request_failed.phase, or response for a complete response whose status is not 2xx.", "type": "string" },
                "kind": { "description": "What kind of failure, read in the same order: for record, line_withheld_<event> from the first withheld line in stream order that is not a certificate's, when it names the event it replaced as a word of a-z, 0-9 and _ starting with a letter, and line_withheld when it does not; otherwise request_failed.error, or status_<code>.", "type": "string" }
              }
            },
            { "type": "null" }
          ]
        },
        "through": { "description": "The Series' pooled figures through this Run; null before its first counted Run.", "anyOf": [{ "$ref": "#/$defs/pool_summary" }, { "type": "null" }] },
        "group_through_as_of_run": { "description": "Its group's pooled figures through this Run (the counted Runs of its group that started at or before it), as they stood through this Run: a Run that started later never changes it, as such a Run never changes through (a Run that started earlier and arrives late can change both: cause (c) of when a month file changes). It is null for two reasons: the Series had had Runs of one group only, up to and including this Run; or its group had had no counted Run by this Run (a group whose first Run is not counted, say), even when through, which pools every group, has figures. requests v1's Derivation has a field group_through that differs from it in one case only: in a Series that later has more than one group, the Derivation gives each point before the Series' first Run of a group other than the first its group's figures, which are then the Series' own, its through. To recover the Derivation's group_through, take through for exactly those points: the points before the first point whose group differs from the first point's, in a Series whose requests_v1 groups number more than one (the Series file's). Take this field as it is for every other point. Never substitute through for a null otherwise: a null on a point of a group with no counted Run yet stands beside a through that holds other groups' figures.", "anyOf": [{ "$ref": "#/$defs/pool_summary" }, { "type": "null" }] }
      }
    }
  }
}
