Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate default values in CLI help message. #1557

Merged
merged 2 commits into from Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/tigerbeetle/cli.zig
Expand Up @@ -126,13 +126,13 @@ const CliArgs = union(enum) {
\\ and should be set as large as possible.
\\ On a machine running only TigerBeetle, this is somewhere around
\\ (Total RAM) - 3GB (TigerBeetle) - 1GB (System), eg 12GB for a 16GB machine.
\\ Defaults to 1GB.
\\ Defaults to {[default_cache_grid_gb]d}GB.
\\
\\ --memory-lsm-manifest=<size><KB|MB|GB>
\\ Sets the amount of memory allocated for LSM-tree manifests. When the
\\ number or size of LSM-trees would become too large for their manifests to fit
\\ into memory the server will terminate.
\\ Defaults to 64MB.
\\ Defaults to {[default_memory_lsm_manifest_mb]d}MB.
\\
\\ --verbose
\\ Print compile-time configuration along with the build version.
Expand All @@ -158,6 +158,14 @@ const CliArgs = union(enum) {
, .{
.default_address = constants.address,
.default_port = constants.port,
.default_cache_grid_gb = @divExact(
constants.grid_cache_size_default,
1024 * 1024 * 1024,
),
.default_memory_lsm_manifest_mb = @divExact(
constants.lsm_manifest_memory_size_default,
1024 * 1024,
),
});
};

Expand Down