{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://totktonada.online/tarantool/perf/compare.schema.json",
 "title": "Tarantool performance: compare",
 "description": "The data of https://totktonada.online/tarantool/perf/compare: the branches' heads against master's, and the pull requests labeled performance against master. The pages are a first version: until they settle, a field may still change incompatibly, the schema with it in the same build. Every build matches its schema.",
 "type": "object",
 "required": [
  "$schema",
  "page",
  "generated",
  "newest",
  "branches",
  "rule",
  "subtests",
  "prs"
 ],
 "additionalProperties": false,
 "properties": {
  "$schema": {
   "type": "string",
   "format": "uri",
   "description": "This schema."
  },
  "page": {
   "type": "string",
   "format": "uri",
   "description": "The page this is the data of."
  },
  "generated": {
   "$ref": "#/$defs/time",
   "description": "When the page was built."
  },
  "newest": {
   "anyOf": [
    {
     "$ref": "#/$defs/time"
    },
    {
     "type": "null"
    }
   ],
   "description": "When the newest run of the 21 days wrote its points; null if none did."
  },
  "branches": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "The branches, master first."
  },
  "rule": {
   "type": "object",
   "required": [
    "times_noise",
    "floor"
   ],
   "additionalProperties": false,
   "properties": {
    "times_noise": {
     "type": "number",
     "description": "Over this many times master's noise in the subtest."
    },
    "floor": {
     "type": "number",
     "description": "And over this fraction."
    }
   },
   "description": "When a difference is marked."
  },
  "subtests": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "series",
     "bench",
     "subtest",
     "page",
     "noise",
     "branches"
    ],
    "additionalProperties": false,
    "properties": {
     "series": {
      "type": "string",
      "description": "The subtest's name in InfluxDB and Otava: <bench>_<subtest>, with /, <, > and : written _."
     },
     "bench": {
      "type": "string",
      "description": "The benchmark: perf/<bench>.cc or perf/lua/<bench>.lua."
     },
     "subtest": {
      "type": "string",
      "description": "The subtest, as the benchmark names it."
     },
     "page": {
      "type": "string",
      "format": "uri",
      "description": "The subtest's page."
     },
     "noise": {
      "anyOf": [
       {
        "type": "number",
        "description": ""
       },
       {
        "type": "null"
       }
      ],
      "description": "Master's noise in the subtest: the median step between its consecutive runs, a fraction; null if master has fewer than two runs of it."
     },
     "branches": {
      "type": "object",
      "additionalProperties": {
       "type": "object",
       "required": [
        "level",
        "level_runs",
        "ratio",
        "beyond"
       ],
       "additionalProperties": false,
       "properties": {
        "level": {
         "anyOf": [
          {
           "type": "number",
           "description": ""
          },
          {
           "type": "null"
          }
         ],
         "description": "The branch's level: the median of its newest runs since its newest change point, five at most; items per second."
        },
        "level_runs": {
         "type": "integer",
         "minimum": 0,
         "description": "How many runs the level is the median of."
        },
        "ratio": {
         "anyOf": [
          {
           "type": "number",
           "description": ""
          },
          {
           "type": "null"
          }
         ],
         "description": "The level against master's: 1.05 is 5% faster; null for master itself, or with a level missing."
        },
        "beyond": {
         "type": "boolean",
         "description": "Whether the difference is past the rule: marked on the page."
        }
       }
      },
      "description": "The branches that have the subtest, by name."
     }
    }
   },
   "description": "Every subtest of a branch, by benchmark."
  },
  "prs": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "pr",
     "title",
     "branch",
     "url",
     "head",
     "heads",
     "runs",
     "base",
     "series"
    ],
    "additionalProperties": false,
    "properties": {
     "pr": {
      "type": "integer",
      "minimum": 0,
      "description": "Its number."
     },
     "title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "description": "Its title, as its newest run has it."
     },
     "branch": {
      "type": "string",
      "description": "Its head branch."
     },
     "url": {
      "type": "string",
      "format": "uri",
      "description": "It on GitHub."
     },
     "head": {
      "$ref": "#/$defs/commit",
      "description": "Its newest head that ran."
     },
     "heads": {
      "type": "array",
      "items": {
       "$ref": "#/$defs/sha"
      },
      "description": "Every head of it that ran, the oldest first."
     },
     "runs": {
      "type": "array",
      "items": {
       "$ref": "#/$defs/run"
      },
      "description": "The runs of its newest head."
     },
     "base": {
      "anyOf": [
       {
        "type": "object",
        "required": [
         "merge_base",
         "sha",
         "subject",
         "distance",
         "runs"
        ],
        "additionalProperties": false,
        "properties": {
         "merge_base": {
          "$ref": "#/$defs/sha",
          "description": "The newest head's merge base with master."
         },
         "sha": {
          "anyOf": [
           {
            "$ref": "#/$defs/sha"
           },
           {
            "type": "null"
           }
          ],
          "description": "The commit of master it is compared with: the newest measured at or before the merge base; null if none in the 21 days was."
         },
         "subject": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ],
          "description": "Its subject; null if the clone does not have the commit."
         },
         "distance": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0,
            "description": ""
           },
           {
            "type": "null"
           }
          ],
          "description": "How many commits that is before the merge base along the first parents: 0 for the merge base itself."
         },
         "runs": {
          "type": "array",
          "items": {
           "$ref": "#/$defs/run"
          },
          "description": "Master's runs of it."
         }
        }
       },
       {
        "type": "null"
       }
      ],
      "description": "What it is compared with; null if the head has no merge base with master in the clone."
     },
     "series": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "series",
        "bench",
        "subtest",
        "page",
        "value",
        "master",
        "ratio",
        "beyond"
       ],
       "additionalProperties": false,
       "properties": {
        "series": {
         "type": "string",
         "description": "The subtest's name in InfluxDB and Otava: <bench>_<subtest>, with /, <, > and : written _."
        },
        "bench": {
         "type": "string",
         "description": "The benchmark: perf/<bench>.cc or perf/lua/<bench>.lua."
        },
        "subtest": {
         "type": "string",
         "description": "The subtest, as the benchmark names it."
        },
        "page": {
         "type": "string",
         "format": "uri",
         "description": "The subtest's page."
        },
        "value": {
         "type": "number",
         "description": "The median of its newest head's runs, items per second."
        },
        "master": {
         "anyOf": [
          {
           "type": "number",
           "description": ""
          },
          {
           "type": "null"
          }
         ],
         "description": "The median of master's runs of the base commit; null for a subtest master does not have."
        },
        "ratio": {
         "anyOf": [
          {
           "type": "number",
           "description": ""
          },
          {
           "type": "null"
          }
         ],
         "description": "value against master: 1.05 is 5% faster."
        },
        "beyond": {
         "type": "boolean",
         "description": "Whether the difference is past the rule."
        }
       }
      },
      "description": "Its subtests."
     }
    }
   },
   "description": "The pull requests labeled performance that ran, the newest first."
  }
 },
 "$defs": {
  "time": {
   "type": "string",
   "format": "date-time",
   "description": "ISO 8601, in UTC+3."
  },
  "sha": {
   "type": "string",
   "pattern": "^[0-9a-f]{12}$",
   "description": "A commit of tarantool/tarantool: the first 12 digits of its hash."
  },
  "run": {
   "type": "object",
   "required": [
    "run",
    "attempt",
    "kind",
    "tag",
    "sha",
    "at",
    "url"
   ],
   "additionalProperties": false,
   "properties": {
    "run": {
     "type": "integer",
     "minimum": 0,
     "description": "The run of perf_micro: its id on GitHub."
    },
    "attempt": {
     "type": "integer",
     "minimum": 1,
     "description": "The attempt of the run."
    },
    "kind": {
     "enum": [
      "push",
      "nightly",
      "manual",
      "tag",
      "pull request"
     ],
     "description": "What started a run: a push to its branch, the nightly schedule (master only), a run by hand, a tag, a pull request labeled performance."
    },
    "tag": {
     "anyOf": [
      {
       "type": "string"
      },
      {
       "type": "null"
      }
     ],
     "description": "The tag of a tag's run; null otherwise."
    },
    "sha": {
     "$ref": "#/$defs/sha",
     "description": "The commit it measured."
    },
    "at": {
     "$ref": "#/$defs/time",
     "description": "When it wrote its points: its own row's time in Otava's tables, or else when its aggregate step started."
    },
    "url": {
     "type": "string",
     "format": "uri",
     "description": "Its job on GitHub."
    }
   },
   "description": "A run of perf_micro on the performance runner."
  },
  "commit": {
   "type": "object",
   "required": [
    "sha",
    "subject",
    "author",
    "date"
   ],
   "additionalProperties": false,
   "properties": {
    "sha": {
     "$ref": "#/$defs/sha"
    },
    "subject": {
     "anyOf": [
      {
       "type": "string"
      },
      {
       "type": "null"
      }
     ],
     "description": "Its subject; null if the clone does not have the commit."
    },
    "author": {
     "anyOf": [
      {
       "type": "string"
      },
      {
       "type": "null"
      }
     ],
     "description": "Its author's name; null likewise."
    },
    "date": {
     "anyOf": [
      {
       "type": "string",
       "format": "date-time"
      },
      {
       "type": "null"
      }
     ],
     "description": "Its commit date, in the time zone git has it in; null likewise."
    }
   },
   "description": "A commit of tarantool/tarantool."
  },
  "change": {
   "type": "object",
   "required": [
    "before",
    "after",
    "pct",
    "seen",
    "possible",
    "drops",
    "shifted",
    "same_commit",
    "commits",
    "code",
    "workflow",
    "compare"
   ],
   "additionalProperties": false,
   "properties": {
    "before": {
     "type": "integer",
     "minimum": 0,
     "description": "The last run before the change: its index in the runs."
    },
    "after": {
     "type": "integer",
     "minimum": 0,
     "description": "The first run after it, likewise."
    },
    "pct": {
     "type": "number",
     "description": "Otava's size of the change, in percent of the level before it: positive is faster."
    },
    "seen": {
     "type": "integer",
     "minimum": 0,
     "description": "How many analyses since saw the same change at the same place, the newest included: a change that comes and goes is seen by few."
    },
    "possible": {
     "type": "integer",
     "minimum": 0,
     "description": "How many analyses ran since: the branch's runs after the change that ran Otava."
    },
    "drops": {
     "type": "integer",
     "minimum": 0,
     "description": "How many times one of those analyses left it out after the one before had reported it: 0 for a change point that stayed once reported."
    },
    "shifted": {
     "type": "boolean",
     "description": "Whether Otava read this subtest's columns shifted: a comma in its name splits the quoted name in the CSV Otava reads, so it took CPU time for items per second."
    },
    "same_commit": {
     "type": "boolean",
     "description": "Whether the runs before and after it measured one commit, so that no code changed between them."
    },
    "commits": {
     "type": "integer",
     "minimum": 0,
     "description": "The commits between the two runs along the first parents, the later run's included; 0 for one commit."
    },
    "code": {
     "type": "boolean",
     "description": "Whether those commits change the code the benchmarks build from: src, third_party, perf, cmake, patches, CMakeLists.txt."
    },
    "workflow": {
     "type": "boolean",
     "description": "Whether they change the workflow that runs the benchmarks."
    },
    "compare": {
     "anyOf": [
      {
       "type": "string",
       "format": "uri",
       "description": ""
      },
      {
       "type": "null"
      }
     ],
     "description": "The commits on GitHub, a compare of the two; null for one commit."
    }
   },
   "description": "A change point of Otava's newest analysis of the branch, between two runs."
  },
  "earlier": {
   "type": "object",
   "required": [
    "before",
    "after",
    "pct",
    "seen",
    "possible",
    "drops",
    "shifted",
    "same_commit",
    "commits",
    "code",
    "workflow",
    "compare",
    "first",
    "last"
   ],
   "additionalProperties": false,
   "properties": {
    "before": {
     "type": "integer",
     "minimum": 0,
     "description": "The last run before the change: its index in the runs."
    },
    "after": {
     "type": "integer",
     "minimum": 0,
     "description": "The first run after it, likewise."
    },
    "pct": {
     "type": "number",
     "description": "Otava's size of the change, in percent of the level before it, as the last analysis that reported it had it: positive is faster."
    },
    "seen": {
     "type": "integer",
     "minimum": 0,
     "description": "How many analyses since reported it; the newest is not one of them."
    },
    "possible": {
     "type": "integer",
     "minimum": 0,
     "description": "How many analyses ran since: the branch's runs after the change that ran Otava."
    },
    "drops": {
     "type": "integer",
     "minimum": 0,
     "description": "How many times one of those analyses left it out after the one before had reported it: 0 for a change point that stayed once reported."
    },
    "shifted": {
     "type": "boolean",
     "description": "Whether the last analysis that reported it read this subtest's columns shifted (a comma in the name)."
    },
    "same_commit": {
     "type": "boolean",
     "description": "Whether the runs before and after it measured one commit, so that no code changed between them."
    },
    "commits": {
     "type": "integer",
     "minimum": 0,
     "description": "The commits between the two runs along the first parents, the later run's included; 0 for one commit."
    },
    "code": {
     "type": "boolean",
     "description": "Whether those commits change the code the benchmarks build from: src, third_party, perf, cmake, patches, CMakeLists.txt."
    },
    "workflow": {
     "type": "boolean",
     "description": "Whether they change the workflow that runs the benchmarks."
    },
    "compare": {
     "anyOf": [
      {
       "type": "string",
       "format": "uri",
       "description": ""
      },
      {
       "type": "null"
      }
     ],
     "description": "The commits on GitHub, a compare of the two; null for one commit."
    },
    "first": {
     "type": "integer",
     "minimum": 0,
     "description": "The run whose analysis reported it first: its index in the runs."
    },
    "last": {
     "type": "integer",
     "minimum": 0,
     "description": "The run whose analysis reported it last, likewise."
    }
   },
   "description": "A change point that earlier analyses of the branch reported and the newest does not: it has none at the same place, between the same two runs."
  }
 }
}
