Bencher Metric Format (BMF)


Built-in benchmark harness adapters convert benchmark output into Bencher Metric Format (BMF) JSON. Custom benchmarking harnesses should output their results as BMF JSON and use the json adapter. See how to track custom benchmarks for a full overview. To generate mock BMF JSON data, use the bencher mock CLI subcommand.

Bencher Metric Format (BMF) JSON Schema

This is the JSON schema for Bencher Metric Format (BMF) JSON:

{
"$id": "https://bencher.dev/bmf.json",
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"patternProperties": {
".+": {
"type": "object",
"patternProperties": {
".+": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"lower_value": {
"type": "number"
},
"upper_value": {
"type": "number"
}
},
"required": ["value"]
}
}
}
}
}

bencher mock

The bencher mock CLI subcommand is used to generate mock Bencher Metric Format (BMF) JSON data.

--count <COUNT>

The number of mock Benchmarks to generate.

--measure <MEASURE>

The Measure to use for each Benchmark. Multiple Measures can be specified by using the --measure option multiple times. The default is the built-in latency Measure.

--pow <POW>

The power of 10 to use for the mock Metrics. The default is 1.

--fail

Fail while running.

--flaky

Intermittently fail while running.

--help

Print the help message.



Published: Sun, May 12, 2024 at 3:12:00 PM UTC