{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "definitions": {
        "ChromeConfig": {
            "additionalProperties": false,
            "properties": {
                "addArguments": {
                    "description": "Additional command-line arguments to pass when launching the browser.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "binary": {
                    "description": "Path to the binary to use when launching this browser, instead of the\ndefault one.",
                    "type": "string"
                },
                "cpuThrottlingRate": {
                    "description": "Optional CPU Throttling rate. (1 is no throttle, 2 is 2x slowdown,\netc). This is currently only supported in headless mode.",
                    "minimum": 1,
                    "type": "number"
                },
                "headless": {
                    "description": "Whether to launch the headless (no GUI) version of this browser.",
                    "type": "boolean"
                },
                "name": {
                    "description": "Name of the browser:\n\nOptions:\n   - chrome\n   - firefox\n   - safari\n   - edge\n   - ie",
                    "enum": [
                        "chrome"
                    ],
                    "type": "string"
                },
                "remoteUrl": {
                    "description": "A remote WebDriver server HTTP address to launch the browser from.",
                    "type": "string"
                },
                "removeArguments": {
                    "description": "Command-line arguments that WebDriver normally adds by default when\nlaunching the browser, which you would like to omit.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "windowSize": {
                    "$ref": "#/definitions/WindowSize",
                    "description": "The size of new windows created from this browser. Defaults to 1024x768."
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "ConfigFileBenchmark": {
            "additionalProperties": false,
            "description": "Expected format of a benchmark in a JSON config file.",
            "properties": {
                "browser": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/ChromeConfig"
                        },
                        {
                            "$ref": "#/definitions/FirefoxConfig"
                        },
                        {
                            "$ref": "#/definitions/SafariConfig"
                        },
                        {
                            "$ref": "#/definitions/EdgeConfig"
                        },
                        {
                            "$ref": "#/definitions/IEConfig"
                        },
                        {
                            "type": "string"
                        }
                    ],
                    "description": "Which browser to run the benchmark in.\n\nOptions:\n   - chrome (default)\n   - chrome-headless\n   - firefox\n   - firefox-headless\n   - safari\n   - edge\n   - ie"
                },
                "expand": {
                    "description": "Recursively expand this benchmark configuration with any number of\nvariations. Useful for testing the same base configuration with e.g.\nmultiple browers or package versions.",
                    "items": {
                        "$ref": "#/definitions/ConfigFileBenchmark"
                    },
                    "type": "array"
                },
                "measurement": {
                    "description": "Which time interval to measure.\n\nOptions:\n   - callback: bench.start() to bench.stop() (default for fully qualified\n     URLs.\n   - fcp: first contentful paint (default for local paths)\n   - global: result returned from window.tachometerResult (or custom\n       expression set via measurementExpression)",
                    "enum": [
                        "callback",
                        "fcp",
                        "global"
                    ],
                    "type": "string"
                },
                "measurementExpression": {
                    "description": "Expression to use to retrieve global result.  Defaults to\n`window.tachometerResult`.",
                    "type": "string"
                },
                "name": {
                    "description": "An optional label for this benchmark. Defaults to the URL.",
                    "type": "string"
                },
                "packageVersions": {
                    "$ref": "#/definitions/ConfigFilePackageVersion",
                    "description": "Optional NPM dependency overrides to apply and install. Only supported with\nlocal paths."
                },
                "url": {
                    "description": "A fully qualified URL, or a local path to an HTML file or directory. If a\ndirectory, must contain an index.html. Query parameters are permitted on\nlocal paths (e.g. 'my/benchmark.html?foo=bar').",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ConfigFilePackageVersion": {
            "additionalProperties": false,
            "properties": {
                "dependencies": {
                    "$ref": "#/definitions/PackageDependencyMap",
                    "description": "Map from NPM package to version. Any version syntax supported by NPM is\nsupported here."
                },
                "label": {
                    "description": "Required label to identify this version map.",
                    "type": "string"
                }
            },
            "required": [
                "dependencies",
                "label"
            ],
            "type": "object"
        },
        "EdgeConfig": {
            "additionalProperties": false,
            "properties": {
                "name": {
                    "description": "Name of the browser:\n\nOptions:\n   - chrome\n   - firefox\n   - safari\n   - edge\n   - ie",
                    "enum": [
                        "edge"
                    ],
                    "type": "string"
                },
                "remoteUrl": {
                    "description": "A remote WebDriver server HTTP address to launch the browser from.",
                    "type": "string"
                },
                "windowSize": {
                    "$ref": "#/definitions/WindowSize",
                    "description": "The size of new windows created from this browser. Defaults to 1024x768."
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "FirefoxConfig": {
            "additionalProperties": false,
            "properties": {
                "addArguments": {
                    "description": "Additional command-line arguments to pass when launching the browser.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "binary": {
                    "description": "Path to the binary to use when launching this browser, instead of the\ndefault one.",
                    "type": "string"
                },
                "headless": {
                    "description": "Whether to launch the headless (no GUI) version of this browser.",
                    "type": "boolean"
                },
                "name": {
                    "description": "Name of the browser:\n\nOptions:\n   - chrome\n   - firefox\n   - safari\n   - edge\n   - ie",
                    "enum": [
                        "firefox"
                    ],
                    "type": "string"
                },
                "preferences": {
                    "additionalProperties": {
                        "type": [
                            "string",
                            "number",
                            "boolean"
                        ]
                    },
                    "description": "Advanced preferences that are usually set from the about:config page\nin Firefox (see\nhttps://support.mozilla.org/en-US/kb/about-config-editor-firefox).",
                    "type": "object"
                },
                "remoteUrl": {
                    "description": "A remote WebDriver server HTTP address to launch the browser from.",
                    "type": "string"
                },
                "windowSize": {
                    "$ref": "#/definitions/WindowSize",
                    "description": "The size of new windows created from this browser. Defaults to 1024x768."
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "IEConfig": {
            "additionalProperties": false,
            "properties": {
                "name": {
                    "description": "Name of the browser:\n\nOptions:\n   - chrome\n   - firefox\n   - safari\n   - edge\n   - ie",
                    "enum": [
                        "ie"
                    ],
                    "type": "string"
                },
                "remoteUrl": {
                    "description": "A remote WebDriver server HTTP address to launch the browser from.",
                    "type": "string"
                },
                "windowSize": {
                    "$ref": "#/definitions/WindowSize",
                    "description": "The size of new windows created from this browser. Defaults to 1024x768."
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "PackageDependencyMap": {
            "additionalProperties": {
                "type": "string"
            },
            "description": "A mapping from NPM package name to version specifier, as used in a\npackage.json's \"dependencies\" and \"devDependencies\".",
            "type": "object"
        },
        "SafariConfig": {
            "additionalProperties": false,
            "properties": {
                "name": {
                    "description": "Name of the browser:\n\nOptions:\n   - chrome\n   - firefox\n   - safari\n   - edge\n   - ie",
                    "enum": [
                        "safari"
                    ],
                    "type": "string"
                },
                "remoteUrl": {
                    "description": "A remote WebDriver server HTTP address to launch the browser from.",
                    "type": "string"
                },
                "windowSize": {
                    "$ref": "#/definitions/WindowSize",
                    "description": "The size of new windows created from this browser. Defaults to 1024x768."
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "WindowSize": {
            "additionalProperties": false,
            "properties": {
                "height": {
                    "description": "Height of the browser window in pixels. Defaults to 768.",
                    "minimum": 0,
                    "type": "integer"
                },
                "width": {
                    "description": "Width of the browser window in pixels. Defaults to 1024.",
                    "minimum": 0,
                    "type": "integer"
                }
            },
            "required": [
                "height",
                "width"
            ],
            "type": "object"
        }
    },
    "description": "Expected format of the top-level JSON config file. Note this interface is\nused to generate the JSON schema for validation.",
    "properties": {
        "$schema": {
            "description": "An optional reference to the JSON Schema for this file.\n\nIf none is given, and the file is a valid tachometer config file,\ntachometer will write back to the config file to give this a value.",
            "type": "string"
        },
        "benchmarks": {
            "description": "Benchmarks to run.",
            "items": {
                "$ref": "#/definitions/ConfigFileBenchmark"
            },
            "minItems": 1,
            "type": "array"
        },
        "horizons": {
            "description": "The degrees of difference to try and resolve when auto-sampling\n(e.g. 0ms, +1ms, -1ms, 0%, +1%, -1%, default 0%).",
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "resolveBareModules": {
            "description": "Whether to automatically convert ES module imports with bare module\nspecifiers to paths.",
            "type": "boolean"
        },
        "root": {
            "description": "Root directory to serve benchmarks from (default current directory).",
            "type": "string"
        },
        "sampleSize": {
            "description": "Minimum number of times to run each benchmark (default 50).",
            "minimum": 2,
            "type": "integer"
        },
        "timeout": {
            "description": "The maximum number of minutes to spend auto-sampling (default 3).",
            "minimum": 0,
            "type": "number"
        }
    },
    "required": [
        "benchmarks"
    ],
    "type": "object"
}