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

Add history trim option #303

Closed
mtreinish opened this issue Mar 15, 2021 · 0 comments · Fixed by #306
Closed

Add history trim option #303

mtreinish opened this issue Mar 15, 2021 · 0 comments · Fixed by #306

Comments

@mtreinish
Copy link
Owner

mtreinish commented Mar 15, 2021

Is your feature request related to a problem? Please describe.

The stestr run history continues to grow over time and can take up multiple gigabytes to store the subunit streams of all the past runs.

Describe the solution you'd like
An stestr command to clear out the N oldest runs or to also delete all the subunit history (but keep the timings db). Something like:

stestr clear all

would delete all the subunit history

stestr clear 10

would delete the 10 oldest runs. The exact syntax can change as I think there are a lot of different ways to slice things up and finding something flexible but easy to use might be a bit trickier.

Describe alternatives you've considered
You can just do this with a bash script pretty easily since the on-disk structure for the file repository is just integers, but it would be nice to have an integrated command to make this simpler. Also for the sql repository type (assuming we ever finish it) having the command would give a consistent interface between both repository types.

mtreinish added a commit that referenced this issue Apr 11, 2021
This commit adds a new command to stestr, history. The history command
is used for interacting with the history of results in the repository.
Prior to this commit you could only interact with the most recent run in
the repository via the last command, but anything older was just taking
up disk space and never used. The history command to start has 3
subcommands, 'list', 'show', and 'remove'. List will generate a table of
all the contents of the repository that will show the run id, the result
of the run, when it started, how long it took, and optionally show any
metadata for the run. Show will show a run in the repository, this is
equivalent to 'stestr last', but takes an optional run id instead of just
unconditionally showing the last run. Remove is used to remove runs from
the repository, this is useful if you don't need the history anymore and
want to clean up some disk space.

Fixes #303
Starts #224
mtreinish added a commit that referenced this issue Apr 11, 2021
This commit adds a new command to stestr, history. The history command
is used for interacting with the history of results in the repository.
Prior to this commit you could only interact with the most recent run in
the repository via the last command, but anything older was just taking
up disk space and never used. The history command to start has 3
subcommands, 'list', 'show', and 'remove'. List will generate a table of
all the contents of the repository that will show the run id, the result
of the run, when it started, how long it took, and optionally show any
metadata for the run. Show will show a run in the repository, this is
equivalent to 'stestr last', but takes an optional run id instead of just
unconditionally showing the last run. Remove is used to remove runs from
the repository, this is useful if you don't need the history anymore and
want to clean up some disk space.

Fixes #303
Starts #224
mtreinish added a commit that referenced this issue Apr 11, 2021
This commit adds a new command to stestr, history. The history command
is used for interacting with the history of results in the repository.
Prior to this commit you could only interact with the most recent run in
the repository via the last command, but anything older was just taking
up disk space and never used. The history command to start has 3
subcommands, 'list', 'show', and 'remove'. List will generate a table of
all the contents of the repository that will show the run id, the result
of the run, when it started, how long it took, and optionally show any
metadata for the run. Show will show a run in the repository, this is
equivalent to 'stestr last', but takes an optional run id instead of just
unconditionally showing the last run. Remove is used to remove runs from
the repository, this is useful if you don't need the history anymore and
want to clean up some disk space.

Fixes #303
Starts #224
mtreinish added a commit that referenced this issue Apr 11, 2021
This commit adds a new command to stestr, history. The history command
is used for interacting with the history of results in the repository.
Prior to this commit you could only interact with the most recent run in
the repository via the last command, but anything older was just taking
up disk space and never used. The history command to start has 3
subcommands, 'list', 'show', and 'remove'. List will generate a table of
all the contents of the repository that will show the run id, the result
of the run, when it started, how long it took, and optionally show any
metadata for the run. Show will show a run in the repository, this is
equivalent to 'stestr last', but takes an optional run id instead of just
unconditionally showing the last run. Remove is used to remove runs from
the repository, this is useful if you don't need the history anymore and
want to clean up some disk space.

Fixes #303
Starts #224
mtreinish added a commit that referenced this issue Apr 11, 2021
This commit adds a new command to stestr, history. The history command
is used for interacting with the history of results in the repository.
Prior to this commit you could only interact with the most recent run in
the repository via the last command, but anything older was just taking
up disk space and never used. The history command to start has 3
subcommands, 'list', 'show', and 'remove'. List will generate a table of
all the contents of the repository that will show the run id, the result
of the run, when it started, how long it took, and optionally show any
metadata for the run. Show will show a run in the repository, this is
equivalent to 'stestr last', but takes an optional run id instead of just
unconditionally showing the last run. Remove is used to remove runs from
the repository, this is useful if you don't need the history anymore and
want to clean up some disk space.

Fixes #303
Starts #224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant