summaryrefslogtreecommitdiffstats
path: root/src/util/progress.rs
AgeCommit message (Collapse)Author
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-13Add LICENSE file and license headersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Fix weird rendering bug of progress barsMatthias Beyer
Apparently, this fixes the rendering bug we had with indicatif. The issue was, that we called `indicatif::ProgressBar::set_message()` before the bar was added to the `indicatif::MultiProgress` object. This caused the bar to be rendered, and as soon we added it to the MultiProgress object and re-called set_message(), it was rendered again. This is of course a bug / inconveniance in indicatif. Either way, the issue was solved by not calling `set_message()` in our `ProgressBars` helper object, but only return a preconfigured bar object. Because not calling the set_message() function yields the whole bunch of helper functions as unnecessary, these were removed and the interface was boiled down to `pub fn ProgressBars::bar(&self) -> indicatif::ProgressBar` which in turn results in a few modifications all over the place. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Make ProgressBars helper able to create spinnersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove unused function: ProgressBars::jobset_bar()Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove unused function: ProgressBars::spinner()Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-14Set job bar length by default to 100Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-13Move log collecting to endpoint codeMatthias Beyer
This patch moves the log-setup and -collecting to the endpoint implementation, that takes care of running the job. This is required because here we aggregate the log and here we know all information that need to be written to the database, so it seems natural to move the log-collecting code (and everything else related to the database entry for the job) to this position in the code. This implies that the "job" is written to the database _after_ it was run. This is due to the fact that we cannot write the job entry before we have the logs. We _have to_ collect the logs in memory (we can also write to a log-dump-file, of course), but we cannot create the job object in the database and then append the logs to it. This might change in the future, but for now that's the way it is done. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add helper to create download barMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add helper to create new spinnerMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-09Change implementation to be able to hide bars easilyMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Implement progress bars in orchestratorMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Add ProgressBars helper for generating bar for jobset and jobMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Degrade ProgressBars to a simple progress-bar-generation helperMatthias Beyer
This patch removes the idea of having a "MultiProgress" object from indicativ available in the top level of butido. It turned out that the progress bars were not updated until the MultiProgress::join() method was called, which basically yields the progress bars useless. Thus, we remove the multi-progress-bar idea from top level. Later, we might implement a multi-progress bar viewing in the orchestrator, so we can see which job is progressed how far. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Change progress bar format to be a configuration parameter.Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-29Re-design main() and progress bar passingMatthias Beyer
This patch rewrites main to use functions to implement subcommands and redesigns how the progress bars are passed around, for less confusion. Initially I did not realize that an indicatif::ProgressBar is just an Arc<_> and thus easy to Clone. With this patch, ProgressBars are cloned around as needed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-28Move progress bar setup to utility moduleMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>