-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
97 additions
and
56 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
services/console/src/chunks/explanation/adapters/bmf-example.mdx
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
services/console/src/chunks/explanation/adapters/bmf-schema.mdx
This file was deleted.
Oops, something went wrong.
19 changes: 7 additions & 12 deletions
19
services/console/src/chunks/explanation/adapters/en/file-size.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
import FileSizeCmdExample from "../file-size-cmd-example.mdx"; | ||
import FileSizeNoCmdExample from "../file-size-no-cmd-example.mdx"; | ||
|
||
### ⚖️ File Size | ||
|
||
The <code><a href="/docs/explanation/bencher-run/">bencher run</a></code> CLI subcommand | ||
can be used to track the file size (ie binary size) of your deliverables with the `--file-size` option. | ||
The `--file-size` option expects a file path to the file who's size will be measured. | ||
Under the hood, <code><a href="/docs/explanation/bencher-run/">bencher run</a></code> | ||
outputs the results as [Bencher Metric Format (BMF) JSON][json]. | ||
It is therefore good practice to explicitly use the `json` adapter. | ||
|
||
With a command: | ||
<FileSizeCmdExample /> | ||
|
||
Without a command: | ||
<FileSizeNoCmdExample /> | ||
outputs the results as[Bencher Metric Format (BMF) JSON][bmf]. | ||
It is therefore good practice to explicitly use [the `json` adapter][json]. | ||
For more details see [how to track file size][file size]. | ||
|
||
The `file-size` Measure (ie `bytes (B)`) is gathered. | ||
Only the file size value (ie `value`) is available. | ||
Neither `lower_value` nor `upper_value` are collected. | ||
The `file-size` Measure is not created by default for all Projects. | ||
However, when you use the `--file-size` option, this Measures will be automatically created for your Project. | ||
|
||
[json]: #-json | ||
[json]: #-json | ||
|
||
[bmf]: /docs/reference/bencher-metric-format/ | ||
[file size]: /docs/how-to/file-size/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
services/console/src/chunks/explanation/adapters/file-cmd-example.mdx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
services/console/src/chunks/explanation/adapters/file-no-cmd-example.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
services/console/src/chunks/how_to/file-size/en/example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import CmdExample from "../cmd-example.mdx"; | ||
import NoCmdExample from "../no-cmd-example.mdx"; | ||
import JsonExample from "../json-example.mdx"; | ||
|
||
If you had a script located at `./my_build_script.sh` that built your binary | ||
at the path `./path/to/my_binary`, | ||
then you could track the size of this binary file with | ||
<code><a href="/docs/explanation/bencher-run/">bencher run</a></code> | ||
and [the `json` adapter][json adapter]. | ||
This would work both with [a benchmark command][bencher run] and without one. | ||
|
||
With a benchmark command: | ||
<CmdExample /> | ||
|
||
Without a benchmark command: | ||
<NoCmdExample /> | ||
|
||
In either case, the generated BMF JSON would look like this, | ||
if `my_binary` had a size of `42` bytes: | ||
|
||
<JsonExample /> | ||
|
||
In this example, the key `my_binary` is the binary file name. | ||
It is used as the name of the [Benchmark][benchmark]. | ||
The `my_binary` object contains the `file-size` key. | ||
`file-size` is the slug for the built-in File Size [Measure][measure]. | ||
The File Size Measure is not created by default for all Projects. | ||
However, when you use the File Size Measure, | ||
it will be automatically created for your Project. | ||
The File Size Measure object contains a [Metric][metric] | ||
with the file size `value` in bytes, `42.0`. | ||
|
||
[json adapter]: /docs/explanation/adapters/#-json | ||
[bencher run]: /docs/explanation/bencher-run/#benchmark-command | ||
|
||
[benchmark]: /docs/explanation/benchmarking/#benchmarks | ||
[measure]: /docs/explanation/benchmarking/#measures | ||
[metric]: /docs/explanation/benchmarking/#metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Bencher supports [the most popular benchmarking harnesses][adapters] out-of-the-box. | ||
Sometimes though, you want to measure the size of your deliverables themselves, | ||
such as the binary size of your executable. | ||
Lucky for you, Bencher also supports tracking file size. | ||
The easiest way to track file size is to use the | ||
<code><a href="/docs/explanation/bencher-run/">bencher run</a></code> CLI subcommand | ||
with the `--file-size` option. | ||
The `--file-size` option expects a file path to the file who's size will be measured. | ||
Under the hood, <code><a href="/docs/explanation/bencher-run/">bencher run</a></code> | ||
outputs the results as [Bencher Metric Format (BMF) JSON][bmf]. | ||
It is therefore good practice to explicitly use [the `json` adapter][json adapter]. | ||
|
||
[adapters]: /docs/explanation/adapters/ | ||
[bmf]: /docs/reference/bencher-metric-format/ | ||
[json adapter]: /docs/explanation/adapters/#-json |
9 changes: 9 additions & 0 deletions
9
services/console/src/chunks/how_to/file-size/json-example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
```json | ||
{ | ||
"my_binary": { | ||
"file-size": { | ||
"value": 42.0, | ||
} | ||
} | ||
} | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: "Track File Size" | ||
description: "How to track file size and binary size as a part of Continuous Benchmarking" | ||
heading: "How to Track File Size with Bencher" | ||
published: "2024-05-13T07:14:00Z" | ||
modified: "2024-05-13T07:14:00Z" | ||
sortOrder: 6 | ||
--- | ||
|
||
import Intro from "../../../chunks/how_to/file-size/en/intro.mdx"; | ||
import Example from "../../../chunks/how_to/file-size/en/example.mdx"; | ||
|
||
<Intro /> | ||
<Example /> | ||
|
||
<br/> | ||
|
||
> 🐰 Congrats! You have learned how to track your file size! 🎉 | ||
<br/> | ||
|
||
<h2><a href="/docs/explanation/benchmarking/">Keep Going: Benchmarking Overview ➡</a></h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters