Reference
measure gate measure-gate(1)
Evaluate the gates of recorded archives, offline: pool them as more executions, print the gates table and exit with the verdicts' code.
Name
measure gate — evaluate the gates of recorded archives, offline
Synopsis
measure gate [-c path] [--baseline name|path]… [option]… archives…Description
Evaluate the gates of recorded archives: pools them as more executions, prints the gates table and exits with the verdicts' code. Nothing is measured: the archives the json reporter wrote are read back, pooled as more executions of the same cases, and their own gates are evaluated together with the config's.
Pooled archives give the same verdicts in any order. A case is selected when any run selected it; a run whose filter excluded it adds nothing to it, and it reads skipped only when no run selected it. Use it to combine the runs of several CI jobs, or to judge an old run again under a stricter config. evaluateArchives makes the same decision from code.
Arguments
Archives written by the json reporter: bench-results.json, or any --output base name plus .json. A file cut short by a crash is read up to its last whole condition.
Options
-c, --config path#Config file whose gates and gate options apply.
Its gates are evaluated beside those the archives recorded, under its gate options; its baseline options apply as in a run.
--allow-inconclusive#Exit 0 instead of 2 when a gate is undecided.
Compare with a recorded run (repeatable)
A name is looked up under the archives' fingerprint; a value containing / or ending in .json is a path. Several baselines pool as more executions.
--max-regression fraction#Fail a case slower than its baseline by more than this fraction.
--allow-foreign-baseline#Compare with another environment's baseline, through normalizeBy.
Compares through the config's baseline.normalizeBy, as the double ratio (case / normalizer) now ÷ (case / normalizer) then.
-h, --help#display help for command.
Verdicts
| verdict | meaning |
|---|---|
| pass | The interval lies entirely on the allowed side of the threshold. |
| fail | The interval lies entirely on the forbidden side of the threshold. |
| inconclusive | The interval contains the threshold, or the executions disagree more than gate.maxDispersion allows. |
| reported | No threshold: estimate and interval only. Never affects the exit code. |
| skipped | A subject was excluded by --filter, or its runtime was not selected. |
| not-applicable | The measure does not run in this runtime. |
| error | A subject failed, is missing, or the metric is unusable. |
| incomparable | The baseline comes from a machine or runtime it cannot be compared with. |
Exit status
| status | name | meaning |
|---|---|---|
0 | success | Every gate passed or reported; nothing failed to measure. |
1 | gateFailed | At least one gate failed: a threshold exceeded beyond the measured spread. |
2 | inconclusive | No failure, at least one gate undecided. allowInconclusive turns this into 0. |
3 | measurementError | A case, condition or child failed, a file did not load, a runtime could not start, or a gate's subject is missing. |
4 | usageError | Invalid flag, config or gate declaration; unknown runtime; incomparable baseline. |
5 | nothingRan | Nothing matched: no file, or every case filtered out. |
130 | interrupted | SIGINT. |
When several apply, the most serious wins: 130, then 4, then 3, then 1, then 2, then 5, then 0.
Examples
measure gate job-1/bench-results.json job-2/bench-results.json job-3/bench-results.json -c bench.config.tsGatesGATE RUNTIME VERDICT ESTIMATE INTERVAL THRESHOLD DISPERSION N REASONratio:new/three node pass 0.847 [0.812, 0.884] (98.75 %) ≤ 1.2 0.012 5/5baseline:* node inconclusive 1.021 [0.994, 1.049] (99.17 %) ≤ 1.03 0.021 3/5 interval contains the threshold1 inconclusive, 1 pass baseline:* (node): parse 10k records > streaming: 1.021× its baseline, [0.994, 1.049] contains ≤ 1.03; more executions would decide (--mode rigorous)
measure gate job-*/bench-results.json -c bench.config.ts --allow-inconclusive