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

Improved CLI: explicit CLI flags for compaction settings #7061

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Aug 5, 2024

Before:

$ RERUN_CHUNK_MAX_ROWS=4096 RERUN_CHUNK_MAX_BYTES=1048576 rerun rrd compact /my/recordings/*.rrd -o output.rrd

After:

$ rerun rrd compact --max-rows 4096 --max-bytes=1048576 /my/recordings/*.rrd -o output.rrd
$ rerun rrd compact --help

Compacts the contents of one or more .rrd/.rbl files and writes the result to a new file.

Uses the usual environment variables to control the compaction thresholds: `RERUN_CHUNK_MAX_ROWS`, `RERUN_CHUNK_MAX_ROWS_IF_UNSORTED`, `RERUN_CHUNK_MAX_BYTES`.

Unless explicit flags are passed, in which case they will override environment values.

Examples:

* `RERUN_CHUNK_MAX_ROWS=4096 RERUN_CHUNK_MAX_BYTES=1048576 rerun rrd compact /my/recordings/*.rrd -o output.rrd`

* `rerun rrd compact --max-rows 4096 --max-bytes=1048576 /my/recordings/*.rrd -o output.rrd`

Usage: rerun rrd compact [OPTIONS] --output <dst.(rrd|rbl)> [PATH_TO_INPUT_RRDS]...

Arguments:
  [PATH_TO_INPUT_RRDS]...


Options:
  -o, --output <dst.(rrd|rbl)>


      --max-bytes <MAX_BYTES>
          What is the threshold, in bytes, after which a Chunk cannot be compacted any further?

          Overrides RERUN_CHUNK_MAX_BYTES if set.

      --max-rows <MAX_ROWS>
          What is the threshold, in rows, after which a Chunk cannot be compacted any further?

          Overrides RERUN_CHUNK_MAX_ROWS if set.

      --max-rows-if-unsorted <MAX_ROWS_IF_UNSORTED>
          What is the threshold, in rows, after which a Chunk cannot be compacted any further?

          This specifically applies to _non_ time-sorted chunks.

          Overrides RERUN_CHUNK_MAX_ROWS_IF_UNSORTED if set.

  -h, --help
          Print help (see a summary with '-h')

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@teh-cmc teh-cmc added 🧑‍💻 dev experience developer experience (excluding CI) do-not-merge Do not merge this PR include in changelog CLI Related to the Rerun CLI labels Aug 5, 2024
@teh-cmc teh-cmc force-pushed the cmc/cli_imp_1_wildcard_inputs branch from 094267c to 106554b Compare August 6, 2024 07:19
Base automatically changed from cmc/cli_imp_1_wildcard_inputs to main August 6, 2024 07:22
@teh-cmc teh-cmc force-pushed the cmc/cli_imp_2_cli_env branch from d467545 to a81737b Compare August 6, 2024 07:22
@teh-cmc teh-cmc removed the do-not-merge Do not merge this PR label Aug 6, 2024
@teh-cmc teh-cmc merged commit dccee13 into main Aug 6, 2024
26 of 29 checks passed
@teh-cmc teh-cmc deleted the cmc/cli_imp_2_cli_env branch August 6, 2024 07:24
@teh-cmc teh-cmc changed the title Improved CLI 2: explicit CLI flags for compaction settings Improved CLI: explicit CLI flags for compaction settings Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Related to the Rerun CLI 🧑‍💻 dev experience developer experience (excluding CI) include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants